Click here to get back home

GetAsyncKeyState and stylus tap position

 HomeNewsGroups | Search

microsoft.public.smartphone.developer - Developing software for MS Smartphone? This is your group! 

get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
GetAsyncKeyState and stylus tap position Grzegorz Aksamit 10-14-2008
Posted by Grzegorz Aksamit on October 14, 2008, 10:42 am
Please log in for more thread options


Hi,

I'm using GetAsyncKeyState(VK_LBUTTON) to asynchronously check for
stylus tap in my C++ native windows mobile application. The problem is
that I need tap position (coordinates) too. Unfortunately
GetCursorPos() doesn't seem to work. I tried something like this:

if( GetAsyncKeyState(VK_LBUTTON) < 0 ) {
POINT pos;
BOOL ret = GetCursorPos(&pos);
// ...
}

On my windows mobile 5 device, GetCursorPos() always returns false.

My application is completely windowless so I don't have a window that
could catch any of WM_* messages (which contain tap position in wParam
or lParam afaik).

Any idea how I could get tap position asynchronously together with
GetAsyncKeyState() ?

Regards
Grzegorz Aksamit

Posted by Dmitry on October 15, 2008, 3:39 am
Please log in for more thread options
Hi,

did you try to use GetMessagePos() ?

http://msdn.microsoft.com/en-us/library/aa925001.aspx

DWORD ptDw =3D GetMessagePos();
POINTS pts =3D MAKEPOINTS(ptDw);
POINT point;
point.x =3D pts.x;
point.y =3D pts.y;

Regards,
Dmitry


you could try GetMessagePos
wrote:
show/hide quoted text


Posted by Grzegorz Aksamit on October 15, 2008, 3:58 am
Please log in for more thread options
show/hide quoted text

I just tried. It returns 0 all the time.

Posted by Dmitry on October 16, 2008, 4:18 am
Please log in for more thread options

Did you try to use this call during WM_LBUTTONDOWN processing ?


wrote:
show/hide quoted text
s
show/hide quoted text
m
show/hide quoted text


Posted by Grzegorz Aksamit on October 16, 2008, 9:42 am
Please log in for more thread options
Well, I'm not getting any WM_LBUTTONDOWN msg because my applicaiton is
windowless, so there is nothing that could receive it. My application
is an DLL service for services.exe

show/hide quoted text
is
show/hide quoted text
at
show/hide quoted text
ram
show/hide quoted text


Similar ThreadsPosted
Getting number keys with GetAsyncKeyState March 11, 2005, 6:49 pm
Get GPS position March 26, 2006, 5:43 pm
Scroll position in dialog August 4, 2005, 1:47 pm
Cursor Position in Textbox September 19, 2005, 9:22 am
Scroll position in Dialog window? July 18, 2005, 5:44 am
critical.How to get position of video from WMP10 with APP made by December 18, 2008, 4:57 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Driving a better car - Fuelzilla.com

Cabling site for homeowners and pros alike - Cabling-Design.com

Friends:

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap
Privacy Policy