post message from App to Internet Explorer

M

Mo

Hi all,
i am writing an App that reads from a barcode scanner.
i want to find a way to send the barcode to an open window (such as
Internet Explorer) so that when the user scans the barcode, the result
is displayed in any text box the user clicked. (the user has to click
on that text box --set focus-- before he triggers the barcode scanner)
i was looking into PostMessage(HWND_BROADCAST,WM_KEYDOWN,barocde,0).
but wasn't working.
i also tried PostMessage(GetForegroundWindow(),WM_KEYDOWN,barocde,0).
but wasn't working either.
my APP is a console app, no output statements (so a windows is not
created)

Any idea?
the window name is non constant so i cannot use
FindWindow( LPCTSTR lpClassName, LPCTSTR lpWindowName );

Your help is greatly appreciated

Thanks
Mo
(e-mail address removed)
 
J

John Harrison

Hi all,
i am writing an App that reads from a barcode scanner.
i want to find a way to send the barcode to an open window (such as
Internet Explorer) so that when the user scans the barcode, the result
is displayed in any text box the user clicked. (the user has to click
on that text box --set focus-- before he triggers the barcode scanner)
i was looking into PostMessage(HWND_BROADCAST,WM_KEYDOWN,barocde,0).
but wasn't working.
i also tried PostMessage(GetForegroundWindow(),WM_KEYDOWN,barocde,0).
but wasn't working either.
my APP is a console app, no output statements (so a windows is not
created)

Any idea?
the window name is non constant so i cannot use
FindWindow( LPCTSTR lpClassName, LPCTSTR lpWindowName );

Your help is greatly appreciated

Thanks
Mo
(e-mail address removed)

Windows programming questions should be asked in a Windows programming
group, such as You are off topic
here since this group is about the C++ language.

john
 
J

JKop

Mo posted:
Hi all,
i am writing an App that reads from a barcode scanner.
i want to find a way to send the barcode to an open window (such as
Internet Explorer) so that when the user scans the barcode, the result
is displayed in any text box the user clicked. (the user has to click
on that text box --set focus-- before he triggers the barcode scanner)
i was looking into PostMessage (HWND_BROADCAST,WM_KEYDOWN,barocde,0).
but wasn't working.
i also tried PostMessage(GetForegroundWindow (),WM_KEYDOWN,barocde,0).
but wasn't working either.
my APP is a console app, no output statements (so a windows is not
created)

Any idea?
the window name is non constant so i cannot use
FindWindow( LPCTSTR lpClassName, LPCTSTR lpWindowName );

Your help is greatly appreciated

Thanks
Mo
(e-mail address removed)

OFF TOPIC

Nonetheless:

Make a window of yours the active window. When the user
clicks the other window, your window should receive a
message WM_LOSTFOCUS or something like that. With any luck
I believe it also gives you the HWND of the new window
that's in focus.

SetWindowText(hWnd,"sjfas;ljf");


-JKop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top