|
Hi Murad,
You can write hook application to monitor system wide key press. Following link might be of some help to you
http://www.codeproject.com/dll/keyboardhook.asp?target=hooks
Check out other hook articles on codeguru
Have fun,
Anunay
|
|
|
|
|
|
It works fine, Thank you!
Best Regards
Murad.
|
|
|
|
|
Hi
My question is: MY program that i wrote is working fine it opens the serial and close it it works fine on a modem BUT when i connect it to the scale it works perfctly.. We have used pascal to do the reading but pascal do not work with windows Xp so have to code in MS visial c++6.
i want to send the scal a character 5 how do i do this in c++?? This is a sample of my pascal program.
PROGRAM SKALE;
USES
Dos, Crt;
CONST
CtrlE=#5; (THIS IS WHAT I WANT TO SEND A CTRLE TO READ THE STRING BACK TO ME!!)
VAR
poort, data: text; {Poort en leer veranderlikes}
junk, gewig: String; {Lees die gewig vanaf skale}
BEGIN
Assign(poort, 'COM1'); {Com2 word gelees vir data}
Assign(data, 'C:\SKALE\IN.TXT'); {Inbrug se data leer}
Rewrite(data);
Rewrite(poort);
Writeln(poort,CtrlE); {Vra skaal vir gewig}
Reset(poort);
Read(poort,junk);
Delay(1000);
Rewrite(poort);
Writeln(poort,CtrlE);
Reset(poort);
Read(poort,gewig); {Lees gewig}
Writeln('Lees ',junk,' vanaf skaal.');
Writeln(data, gewig); {Skryf gewig in leer}
Close(poort);
Close(data);
END.
Thank you
Tiaan Strydom
|
|
|
|
|
Check out MSDN.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp
Kuphryn
|
|
|
|
|
I am porting a 32-bit MFC application to 64-bit Windows.
I will be using Windows Server 2003 64-bit and Visual C++ .net 2003 Standard Win32 Edition .
1) Will there be a compatibility issue between these 2?
2) Does Visual C++ .net 2003 support 64-bit using the /WP64 switch? Does it have some extra/ other switches for 64-bit support?
|
|
|
|
|
MSDN information on 64-bit Windows[^].
64-bit applications at present can only be built using the compilers in the Driver Development Kit[^]. For the most part, Win64 is a pure extension of Win32 with some pointer and integer types extended to 64 bits. In terms of compatibility, you can run most IA-32 binaries on a 64-bit platform (albeit slowly at present on Itanium), but I don't think that's what you were after.
Visual C++ .NET 2003 uses version 13.10 of the x86 compiler, which supports the /wp64 64-bit portability warning switch. This switch detects conversions from types tagged __w64 to types smaller than 64 bits without this tag.
It should be possible to use the 64-bit compilers from VS.NET using a makefile project, or by changing the directories options. However, you won't be able to debug from VS.NET at present, as it only understands x86 native code. You'll have to use WinDBG, from the Microsoft Debugging Tools[^] kit.
|
|
|
|
|
I have written an application which has a splitter window (2 panes), I hvae written 2 different view Classes for these panes. In one view I have a List box and in the other I have a Dialog box with a few controls.
Now as I change the selection of items in the list box, I need to disable/ enable certain controls in the other pane. How do I communicate between the two panes
With Regards
|
|
|
|
|
Each view should communicate with the other either by sending messages to the parent. Yes, one view could send a message directly to the other, but then those two views are now "tied" together.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Store pointer of these views as member variable in your CMainFrame class. Write some function which will return you these pointer. Use CMainFrame object to access these functions
|
|
|
|
|
Hi All,
I want to show all machine names, present on the network, through Browse button.
The API NetQueryDisplayInformation() does not support Windows 98 and my application will run on Windows 98.
Does anybody can help me in this regard ?
Regards,
MPB
Hi,
Good site
|
|
|
|
|
See if WNetOpenEnum()/WNetEnumResource() will help.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi
I am writing an application in VC that has to automatically reboot itself (occasionally the vendors graphics drivers fail and the only way to resolve it is by rebooting)
How do I force a reboot in Window (2000 Pro) There seems to be a command for it in VB but I haven't found anything in VC
Thanks for any help
|
|
|
|
|
How about ExitWindows[Ex]() ?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Found it.
For anybody who cares, you call ExitWindowsEx to force a system shut down.
|
|
|
|
|
You must use AdjustTokenPrivileges for NT/2000/XP to use ExitWindowsEx(...).
I found this on the internet.
DWORD dwVersion = GetVersion();
if ( dwVersion < 0x80000000)
{
HANDLE hToken;
LUID tmpLuid;
HANDLE handleProcess=GetCurrentProcess();
if (!OpenProcessToken(handleProcess,TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
return;
if (!LookupPrivilegeValue(0,"SeShutdownPrivilege", &tmpLuid))
return;
TOKEN_PRIVILEGES NewState;
LUID_AND_ATTRIBUTES luidattr;
NewState.PrivilegeCount = 1;
luidattr.Luid=tmpLuid;
luidattr.Attributes=SE_PRIVILEGE_ENABLED;
NewState.Privileges[0]=luidattr;
if (!AdjustTokenPrivileges(hToken, false, &NewState, sizeof(TOKEN_PRIVILEGES), 0, 0))
return;
}
ExitWindowsEx(...);
|
|
|
|
|
I'm processing OnInitDialog of a MFC dialog-based application, before the window is shown. Sometimes i need to close this dialog and i'm using PostQuitMessage(0) , but the window will flash for a short moment before the application ends.
Do you know what is the easiest way of getting rid of that flash? I can handle it but my solution is not quite simple.
rechi
|
|
|
|
|
|
|
Use EndDialog() instead.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
|
How Can i change the name of the child window in an MDI application developed using MFC Appwizard...
|
|
|
|
|
Just go to the correspondind child windows document class's classwizard and add function SetTitle.... in that function u can set the name u want to the child window..
gudluck
adi
|
|
|
|
|
GetActiveFrame()->SetWindowText("helloman");
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
Anybody knows how collect information from user`s computer and how this unformation use ?
How to debug those applications ?
|
|
|
|