PC Review


Reply
Thread Tools Rate Thread

[API] WindowFromPoint and Popup Form

 
 
Alessandro Baraldi
Guest
Posts: n/a
 
      6th Sep 2006
My action start on Form_MouseDown, where i set a flagmemory.
I need to detect on Form_MouseUp Event if the MousePointer is on
MDIClient area.

So if the Form is not Popup this way work good:

hWndMDI = FindWindowEx(Application.hWndAccessApp, _
0&, _
"MDIClient", _
vbNullString)
rValue = GetCursorPos(pt)

Handle = WindowFromPoint(pt.x, pt.y)

If hWndMDI <>handle Then
' No you are not on MDI_Client
Else
' Yes MDI is under Mouse
End if

If my Form is Popup the Handle i can get is Application.hWndAccessApp
and not MDIClient
so i can't have a right detection...!

How can i get the MDIClient Handle even if my form is Popup, How can i
detect if my pointer
is really on MDIClient...?

May be using:

GetWindowRect hWndMDI , rectParent

and if X position is more then rectParent.TOP my pointer is
inside....?(i don't like it)

Thank's

@Alex

 
Reply With Quote
 
 
 
 
Alessandro Baraldi
Guest
Posts: n/a
 
      6th Sep 2006

Alessandro Baraldi ha scritto:

> My action start on Form_MouseDown, where i set a flagmemory.
> I need to detect on Form_MouseUp Event if the MousePointer is on
> MDIClient area.
>
> So if the Form is not Popup this way work good:
>
> hWndMDI = FindWindowEx(Application.hWndAccessApp, _
> 0&, _
> "MDIClient", _
> vbNullString)
> rValue = GetCursorPos(pt)
>
> Handle = WindowFromPoint(pt.x, pt.y)
>
> If hWndMDI <>handle Then
> ' No you are not on MDI_Client
> Else
> ' Yes MDI is under Mouse
> End if
>
> If my Form is Popup the Handle i can get is Application.hWndAccessApp
> and not MDIClient
> so i can't have a right detection...!
>
> How can i get the MDIClient Handle even if my form is Popup, How can i
> detect if my pointer
> is really on MDIClient...?
>
> May be using:
>
> GetWindowRect hWndMDI , rectParent
>
> and if X position is more then rectParent.TOP my pointer is
> inside....?(i don't like it)
>
> Thank's
>
> @Alex


At last is Pointe.Y>rectParent.TOP to be on MDIClient...!

This solution Work, but i don't know if it's a right one....

@Alex

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Win32 APIs ChildWindowFromPoint and WindowFromPoint Steve Microsoft C# .NET 2 27th Oct 2010 08:12 PM
populate fields on original form from info on popup form =?Utf-8?B?a2F0cGh5c2g=?= Microsoft Access Forms 1 13th Jul 2006 05:04 AM
Popup form not displaying controls, displays calling form that it is hovering over instead =?Utf-8?B?U3VlIFRob21hcw==?= Microsoft Access Forms 0 25th Jan 2004 03:56 AM
Exception in WindowFromPoint on Emulator Richard Dutrulle Microsoft Dot NET Compact Framework 2 7th Aug 2003 01:21 PM
CF Emulator : Exception in WindowFromPoint Richard Dutrulle Microsoft Dot NET Compact Framework 0 6th Aug 2003 08:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:54 PM.