Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
EXE forced in front of other EXE at runtime
Message
 
À
14/04/2015 12:58:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01618033
Message ID:
01618406
Vues:
54
>>>>>>>>Hi Gang!
>>>>>>>>
>>>>>>>>Questioin.....
>>>>>>>>
>>
>>(snip)
>>
>>>
>>>>*DECLARE INTEGER FindWindow IN user32 STRING lpClassName, STRING lpWindowName
>>>>DECLARE INTEGER BringWindowToTop IN user32 INTEGER hWindow
>>>>
>>>>*hWnd = FindWindow(Null, Thisform.Caption)
>>>>BringWindowToTop(Thisform.HWnd)
>>>>
>>>>In a method called from a countdown time ( that just runs once for testing purposes) in a form. When it fires, and goes through this code, the window stays behind any other window and/or form ( I quickly cover the form up with other forms and exes before the time expires ).
>>>>
>>>>Any idea what I am doing incorrectly ??
>>>>
>>>
>>>I just looked at the application where I'm doing something like this and I see that I'm using SetForegroundWindow rather than BringWindowToTop,
>>>
>>>Tamar
>>
>>Sorry to bother you, Tamar.
>>
>>I am having some problems implementing this. Any chance I can peek at some of the code you are referring to that is working for you?
>>
>
>I have this method in my application object:
>
>
>	PROCEDURE GrabFocus
>	* Make sure NMS has focus
>	
>	DECLARE INTEGER SetForegroundWindow IN user32 INTEGER hwnd
>
>	SetForeGroundWindow(This.oMain.hWnd)
>	
>	RETURN
>
>
>This.oMain is a reference to the main form of the application, which is a top-level window. I call the method as part of my start-up process.
>
>Tamar

I tried this, and instead of the EXE coming to the foreground, the taskbar icon for the EXE starts to blink, alerting me to the fact it wants something (for me to click it?). I thought I read on the Internet somewhere that with Windows 7 and above, Microsoft turned off this ability to make an EXE set the foreground unless it linked its thread to the thread that HAD the foreground (which Tore's code was trying to do... his code actually went into the part of the IF/ELSE/ENDIF that would handle that, but it also would not go to the ForeGround. sigh......... such is life.....

Thanks for helping me out!
Tommy Tillman A+ NetWork+ MCP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform