PDA

Click to See Complete Forum and Search --> : Here's something heavy...


Allied
Mar 28th, 2001, 10:14 PM
Ok guys... here's something heavy... Guess I won't receive any answer, but well, I'll try ;) Try to make some new project with a full screen form, no border, in any res you want, and add a tray icon [http://www.vb-world.net/api/tip61.html] (with some API call) for it... when it starts (The form shows), it change your resolution automatically [http://www.andreavb.f2s.com/tip090004.html] (another API call...) with the project (ie: 800x600)... make some button that when you click on, it hide the form and change your res to your initial configuration (ie: 1024x768)... now check at the mouseon_event of the picturebox that your tray icon uses... the "Case WM_LBUTTONDBLCLK" will change your res back to 800x600 and show the form again.. but the form wont get any focus: you need to click on it before... why??? when you make some menu and your dbl click call it, instead of showing off the form, the form gets focus! Can someone experienced help me please?

mlewis
Mar 29th, 2001, 05:24 AM
Aaaaaa! Whoa! Slow down and explain this a little better...then maybe someone can help you.

PatrickCorgan
Mar 30th, 2001, 02:20 AM
If all you want is to set the focus to your program, there is an API call that'll do that.

Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long

SetForeGroundWindow Me.hWnd


That should do it...

Allied
Mar 30th, 2001, 09:53 AM
I've already tried SteForeGroundWindow... But it doesn't work :( Really... it's an enigma...

Mar 30th, 2001, 02:50 PM
Is there any specific window that is always getting the focus over yours?

Allied
Mar 30th, 2001, 05:49 PM
Well... There's something that must get focus over my window, cause I really need to click somewhere on the form to get his focus... But what I think is strange is the fact that my form wont get focus only if I double click on the tray icon, and only if the resolution is changed immediately after this click... If my form keeps the same res, everything will be ok... And if I show my form within a call in some menu (in my project: called with right click on the tray icon), everythin is'all right... again... This is very strange... Could this be my windows system? I think I'm gonna post some sample code...