Results 1 to 5 of 5
  1. #1
    loller0078's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    2

    Skip Focus Check

    Dear hackers,
    I am investigating on how to keep the game running when the game is not in running in foreground.
    I have detoured a few WINAPI functions like:
    user32 GetForegroundWindow,
    user32 GetFocus and
    user32 GetActiveWindow to always return HWND eflc = FindWindowA(0, "EFLC");

    example:

    Code:
    HWND WINAPI hGetForegroundWindow(void)
    {
    	HWND window = oGetForegroundWindow();
    	Log->Write("hGetForegroundWindow %i", window);
    
    	HWND eflc = FindWindowA(0, "EFLC");
    	Log->Write("EFLC %i", eflc);
    	
    	return eflc;
    }
    Tho this does not have the desired result, the game is still frozen when not in foreground.

    Would you have some suggestions?

    Thanks in advance!

  2. #2
    Konker131's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    4
    would this blog be helpful?

    devblog.lcpdfr(dot)com/2013/12/multiplayer-mode-taking-a-look-at-disconnects-scripting-problems/

  3. #3
    loller0078's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    2
    Thanks for that link. The information there confirms what i was thinking on where to look.
    I managed to kind of reach my goal, but am far from pleased with the results.
    I will share with you my results.

    Note: All the following information has been tested with windowed mode. This can be achieved by having the -windowed argument in the gta4.exe launch path.

    Code:
    //The following hooks the windowmessages. Whenever things happen in a window, the window will send messages to this function.
    WNDPROC	g_gameWndProc;
    
    g_gameWndProc = ( WNDPROC )SetWindowLongA( GAME_HWND, GWL_WNDPROC, ( LONG )WindowProc );
    
    //The following line will unhook the windowproc(), it should go into your unhook function.
    SetWindowLongA( GAME_HWND, GWL_WNDPROC, ( LONG )g_gameWndProc );
    
    //Now in our hooked function we check for the message WM_NCACTIVATE and block it.
    //You will see I will pass WM_KILLFOCUS, but you could just have returned NULL for the same result.
    
    LRESULT CALLBACK WindowProc( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam )
    {
    	if(Msg == WM_NCACTIVATE && wParam == 0)
    	{
    		Log->Write("WM_NCACTIVATE for hWnd %i wParam %i lParam %i", hWnd, wParam, lParam);
    		
    		return CallWindowProc( g_gameWndProc, hWnd, WM_KILLFOCUS, wParam, lParam );
    	}
    
    	return CallWindowProc( g_gameWndProc, hWnd, Msg, wParam, lParam );
    }
    After doing that, congratulations, after ALT+TAB the window stays active.
    Tho there is one problem, the window holds the mouse focus and you cannot leave.
    I did found the following workaround:

    -If you want to keep the game running and want full interaction with another window (like your webbrowser) you should minimize GTA4 with the use of shortcut "WINDOWS KEY + KEY DOWN".
    -Then it will minimize into your taskbar.
    -Click GTA4 in your taskbar to show the window. The GTA4 window now has focus
    -Now ALT+TAB and perform a mouseclick.

    You now have GTA4 running while not interacting with the window.

  4. The Following User Says Thank You to loller0078 For This Useful Post:

    Konker131 (11-24-2014)

  5. #4
    loller0078's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    2
    I just happened to find a method that doesnt require hacking the game at all lol.
    To keep GTA4 active (I tested this with EFLC in windowed mode) do the following.
    -Get ingame
    -Press WINDOWS KEY (now your startmenu opens and your mouse pointer is invisible)
    -Quickly move your mouse down to your taskbar and click a running task while moving the mouse. (you might need to retry a few times)

    I know this is not the most comfortable method but it doesnt involve any code changes.

  6. The Following User Says Thank You to loller0078 For This Useful Post:

    Konker131 (11-24-2014)

  7. #5
    stichbash's Avatar
    Join Date
    Sep 2016
    Gender
    male
    Posts
    51
    Reputation
    10
    Thanks
    494
    My Mood
    Angry
    cool shit here

Similar Threads

  1. [Tutorial] Skipping "Check" New Post With Images
    By AFG4Lifee in forum Piercing Blow Tools
    Replies: 20
    Last Post: 03-08-2011, 06:05 PM
  2. HOW to skip pb start up check
    By dad4rr in forum Piercing Blow Discussions
    Replies: 23
    Last Post: 03-03-2011, 10:28 AM
  3. Skipping the Check in the Game Launcher
    By Rizball in forum Piercing Blow Discussions
    Replies: 1
    Last Post: 02-27-2011, 04:05 PM
  4. Skip "Checking" on start up!
    By ftslynx in forum Piercing Blow Discussions
    Replies: 23
    Last Post: 02-19-2011, 01:29 PM
  5. Lol check out my crappy sig
    By Severed in forum Art & Graphic Design
    Replies: 1
    Last Post: 02-21-2006, 11:05 AM