Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2008
    Posts
    26

    Window.Restore help

    hi there i have made a program that blocks the desktop and every key combination for the user yet provides a nice interface to to let him pick what game he want (i have a computer gaming center) and i have did a lot of coding but i faced a big problem:

    i have used the SSides dll's to block the keys but when i run a game inside this game i can use these keys that SSides dll's ave blocked , and i have made a script when the user press a button to launch a game it removes any other buttons on the application so that they dont run two or more games at the same time , but if he run a game then press CTRL+ESC the game will minimize and he will get stuck because no buttons are visable to him unless he quits the game.

    so i did a button to make the game maximize but it didn't work as i want here its code.

    Code:
    processes = Window.EnumerateProcesses();
    pro = {};
    pro[1] = "BF2.exe";
    pro[2] = "CoD2MP_s.exe";
    pro[3] = "CoD2SP_s.exe";
    pro[4] = "cstrike.exe";
    pro[5] = "quake3.exe";
    pro[6] = "Transformers.exe";
    pro[7] = "AirRaid.exe";
    pro[8] = "Tqit.exe";
    pro[9] = "Onslaught.exe";
    pro[10] = "hl2.exe";
    pro[11] = "Game.exe";
    
    for i = 1, 11 do
    Window.Restore(pro[i]);
    Window.Maximize(pro[i]);
    Window.Show(pro[i]);
    end
    these codes are in the on click tab on the button

    note : the pro = {} is the names of the games EXE's that run in the taskmaneger


    thanks

  2. #2
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Well you're trying to restore a window without parsing a windowhandle but a string.

    Code:
    Windowhandle=Application.GetWndHandle();
    
    Window.Restore(Windowhandle) 
    Window.Show(Windowhandle) 
    Window.Maximize(Windowhandle)
    You could try to fetch all titles and handles using

    Code:
    Windows=Window.EnumerateTitles(true);
    if(Windows)then
        for handle, title in Windows do
            --Actions using the windowhandle
            Window.Restore(handle)
            Window.Show(handle)
            --etc...
        end
    end
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  3. #3
    Join Date
    Nov 2008
    Posts
    26
    thanks but i will try it tomorrow when i get to my work pc , but how can i let it just look for only these exe's that i wrote before .


    thanks

  4. #4
    Join Date
    Nov 2008
    Posts
    26
    hi there
    it works as i want thanks , but it search for all titles in the task manager , how can i make it search only for titles i write for like these:

    pro = {};
    pro[1] = "BF2.exe";
    pro[2] = "CoD2MP_s.exe";
    pro[3] = "CoD2SP_s.exe";
    pro[4] = "cstrike.exe";
    pro[5] = "quake3.exe";
    pro[6] = "Transformers.exe";
    pro[7] = "AirRaid.exe";
    pro[8] = "Tqit.exe";
    pro[9] = "Onslaught.exe";
    pro[10] = "hl2.exe";
    pro[11] = "Game.exe";

    sorry but i still don't understand how can i use [Application.GetWndHandle(?)] well in my application , what can i put in place of the ? , what it really do???


    thanks a lot

  5. #5
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Application.GetWndHandle accepts no arguments, it returns the Window Handle for your application. That's it.

    if you search the forum for Close Multiple Instances you'll find more information about this.
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts