Results 1 to 6 of 6

Thread: Here's something heavy...

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Location
    Jonquière, Qc, Canada
    Posts
    15

    Question

    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?
    - Allied

  2. #2
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    Aaaaaa! Whoa! Slow down and explain this a little better...then maybe someone can help you.
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  3. #3
    Member PatrickCorgan's Avatar
    Join Date
    Feb 2001
    Location
    Vashon Island, WA, USA
    Posts
    39
    If all you want is to set the focus to your program, there is an API call that'll do that.
    Code:
    Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
    
    SetForeGroundWindow Me.hWnd
    That should do it...
    -Patrick
    Visual Basic 6 SP5
    Master Programmer Wannabe

    Check out the API-Guide for all your API needs!

    --Soli Deo Gloria--

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Location
    Jonquière, Qc, Canada
    Posts
    15

    Unhappy Doesn't work

    I've already tried SteForeGroundWindow... But it doesn't work Really... it's an enigma...
    - Allied

  5. #5
    Guest
    Is there any specific window that is always getting the focus over yours?

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Location
    Jonquière, Qc, Canada
    Posts
    15

    Question Well...

    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...
    - Allied

Posting Permissions

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



Click Here to Expand Forum to Full Width