|
Check your (rc) resouce file. Do you have a multi language resource in it? A resource that deal with any language must be set [Neutral].
|
|
|
|
|
Thanks! I checked resource file, there is no multi language used. "LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US" is found in rc file.
|
|
|
|
|
Hey there,
I am writing an software that should be able to detect all keyboard inputs by the user. i.e., both hardware and software/on-screen keyboard.
This software is going to be written in a platform independent way and supposed to run on Windows, Linux, Android & iOS.
The idea is to capture the keyboard inputs from a low level, there by making sure that it doesn't miss any inputs even if it's a on-screen keyboard like in a mobile device.
I am looking at possible open source libraries that can be used.
Anyone got any good ideas on what to use?
Thanks in advance!
|
|
|
|
|
Given that those platforms have very different operating systems and hardware it is unlikely that you will find a library that can handle each type, especially at the hardware level. If you want open source code then Google should be your search tool.
|
|
|
|
|
A cross-plattform key-logger ? This sounds like the ultimate trojan, so finding resources will not be easy...
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what it used to.
|
|
|
|
|
For Windows, here is a global key hook example, prints pressed keycodes to the console. It even works when it's in the background.
And this is a Windows discussion board, also ask in Linux, Android and IOS sections for answers..
#include <windows.h>
#include <stdio.h>
HHOOK hKeyboardHook;
__declspec(dllexport) LRESULT CALLBACK KeyboardEvent (int nCode, WPARAM wParam, LPARAM lParam)
{
DWORD SHIFT_key=0;
DWORD CTRL_key=0;
DWORD ALT_key=0;
if ((nCode == HC_ACTION) && ((wParam == WM_SYSKEYDOWN) || (wParam == WM_KEYDOWN)))
{
KBDLLHOOKSTRUCT hooked_key = *((KBDLLHOOKSTRUCT*)lParam);
DWORD dwMsg = 1;
dwMsg += hooked_key.scanCode << 16;
dwMsg += hooked_key.flags << 24;
char lpszKeyName[1024] = {0};
lpszKeyName[0] = '[';
int i = GetKeyNameText(dwMsg, (lpszKeyName+1),0xFF) + 1;
lpszKeyName[i] = ']';
int key = hooked_key.vkCode;
SHIFT_key = GetAsyncKeyState(VK_SHIFT);
CTRL_key = GetAsyncKeyState(VK_CONTROL);
ALT_key = GetAsyncKeyState(VK_MENU);
if (key >= 'A' && key <= 'Z') mmmmmmcjmcfkgkgcgkj.j.g
{
if (GetAsyncKeyState(VK_SHIFT)>= 0) key +=32;
if (CTRL_key !=0 && key == 'y' )
{
MessageBox(NULL, "CTRL-y was pressed\nLaunch your app here", "H O T K E Y", MB_OK);
CTRL_key=0;
}
if (CTRL_key !=0 && key == 'q' )
{
MessageBox(NULL, "Shutting down", "H O T K E Y", MB_OK);
PostQuitMessage(0);
}
printf("key = %c\n", key);
SHIFT_key = 0;
CTRL_key = 0;
ALT_key = 0;
}
printf("lpszKeyName = %s\n", lpszKeyName );
}
return CallNextHookEx(hKeyboardHook, nCode,wParam,lParam);
}
void MessageLoop()
{
MSG message;
while (GetMessage(&message,NULL,0,0))
{
TranslateMessage( &message );
DispatchMessage( &message );
}
}
DWORD WINAPI my_HotKey(LPVOID lpParm)
{
HINSTANCE hInstance = GetModuleHandle(NULL);
if (!hInstance) hInstance = LoadLibrary((LPCSTR) lpParm);
if (!hInstance) return 1;
hKeyboardHook = SetWindowsHookEx ( WH_KEYBOARD_LL, (HOOKPROC) KeyboardEvent, hInstance, NULL );
MessageLoop();
UnhookWindowsHookEx(hKeyboardHook);
return 0;
}
int main(int argc, char** argv)
{
HANDLE hThread;
DWORD dwThread;
hThread = CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE) my_HotKey, (LPVOID) argv[0], NULL, &dwThread);
if (hThread) return WaitForSingleObject(hThread,INFINITE);
else return 1;
}
|
|
|
|
|
Thanks for the code!
Does this work if it's a on-screen/software key board?
|
|
|
|
|
This application is working fine on 2003 R2 and 2000 Servers and even our other 2008 R2 server but I keep getting the error on this new server. I could have sworn I had to do some tweak to get it working on 2008 R2 but I can't remember what it was. Basically what is happening is the application is doing a DB "query" that is taking a fair amount of time and as a result the UI is no longer "responding" even though the applicaion is working away and in fact not frozen/locked/in an infinite loop. The application is written in VS 6 and as you can see in both the description and below using MFC.
Problem signature:
Problem Event Name: APPCRASH
Application Name: qexectest.exe
Application Version: 1.0.0.1
Application Timestamp: 46b1e781
Fault Module Name: MFC42D.DLL
Fault Module Version: 6.0.8168.0
Fault Module Timestamp: 358870e1
Exception Code: c0000005
Exception Offset: 0002b4af
OS Version: 6.1.7601.2.1.0.16.7
Locale ID: 1033
Additional Information 1: d67f
Additional Information 2: d67fe74012b2fff2bcc60d9e40d9bbd3
Additional Information 3: 7b8d
Additional Information 4: 7b8d5be233f423bf0e8bf92697c74b98
|
|
|
|
|
MacRaider4 wrote: ...the UI is no longer "responding"... This is usually related to the main thread processing something and the UI cannot respond to the WM_NULL message.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
That is correct, it is however working "fine" on the other 2008 R2 Server. The window grays out and has "not responding" in the ribbon, but it still carries on and completes. However on this server it quits.
|
|
|
|
|
I recommend that you use the remote debugging tools in Visual Studio to find where it is hanging up.
Remote Debugging[^]
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
My code looks like this:
int CMainClass::Start()
{
.......
for(int = 0; i<size; i++)
{
CWinThread * pWinThread = AfxBeginThread(MyThreadFunction, this);
}
.......
}
.......
UINT __cdecl MyThreadFunction(LPVOID pParam)
{
CMainClass *pArg = (CMainClass*) pParam;
pArg->GetList(); return 0;
}
........
int CMainClass::GetList()
{
HINSTANCE hLibrary = LoadLibrary(L"winhttp.dll");
........
........
FreeLibrary(hLibrary);
return 0;
}
My problem is that despite the call to FreeLibrary(), winhttp.dll is not unloaded. Each new thread I create allocate memory in the heap, but the call to FreeLibrary() does not release that memory.
Is there a way to force the unloading of the library and the release of the memory?
Thank you!
modified 12-Mar-14 17:43pm.
|
|
|
|
|
Member 10215814 wrote: Each new thread I create allocate memory in the heap, but the call to FreeLibrary() does not release that memory.
What makes you think that the first is related to the second?
|
|
|
|
|
I'm not sure I understand your question...
I have no memory leaks and I see the memory usage increasing at every new created thread. So I presume that the "per-thread" heap memory is not released by the call to FreeLibrary().
|
|
|
|
|
MarxF wrote: I presume that the "per-thread" heap memory is not released by the call to FreeLibrary(). Why would it be? The two are not related.
|
|
|
|
|
A common misconception about Task Manager numbers is that they tell something about the memory your program is consuming. This is not what those numbers tell you. They tell you the amount of address space that is in use. This has nothing to do with the amount of that address space your program is actually using. The blocks of memory that your code, or the library, freed are still in the address space, but they are available for subsequent allocation. The numbers you see in Task Manager are almost but not quite completely useless for telling how much of your memory is in use. If you see it shrink, this is good, but if you don't, it is not necessarily bad. If it's really important to you, use the heap-walking functions to track what is going on.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
As already noted, there is no relation between the mapping of the library into the address space of your process and the memory allocated by your threads.
LoadLibrary works per process, not per thread. So you add can add a HINSTANCE member variable to your class, load the library from within the constructor or your Start() function, and free the library in the destructor.
|
|
|
|
|
Dear all:
I try to beep from buzzer(not speaker) on motherboard in win 7. How can I use winRing0.dll to control buzzer make sound?
Does any sample code or link?
And I need the winring0.lib, winring0x64.lib, winring0.sys, winring0.dll, winring0x64.dll, winring0x64.sys.
I search these files so difficult.
Who can give me these files or a valid download link, please?
Thanks for your help, Victor.
modified 12-Mar-14 12:36pm.
|
|
|
|
|
|
Dear Rage:
I can't download with the link by used Svn.
Could you send me these files, please?
I have been try your reference, but it still no sound with buzzer.
Thank for your help, Victor
|
|
|
|
|
cedricvictor wrote: Could you send me these files, please?
You would have to install svn to be able to check out. I have no installation of svn on my working computer, so I will not be able to send you the files.
cedricvictor wrote: I have been try your reference, but it still no sound with buzzer
Is the code running ? Is your buzzer working at all ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what is used to.
|
|
|
|
|
Hello. I am a beginner in audio/video.
+ Why do we use Sleep() function (or timer) when we are processing audio/video samples.
+ If we are rendering a video where our frame rate is 29 fps, then what value should be passed to the Sleep() function?
+ Is this what is known as Latency?
modified 12-Mar-14 6:23am.
|
|
|
|
|
- Sleep is used to pause programm execution. I don't know why are you using it while processing audio/video.
- Again, it depends on your actual implementation.
- No, that's not latency, see Wikipedia[^].
Veni, vidi, vici.
modified 12-Mar-14 9:13am.
|
|
|
|
|
I may have wrongly used the term processing. I am actually displaying the video frames (frame rate = 29.97 fps) onto a dialog. Now when I didn't use Sleep(), the 18 second video completed in just 4-5 seconds. But after putting Sleep(25), it almost runs normally. What does this mean to you?
modified 12-Mar-14 9:01am.
|
|
|
|
|
Can you post your code ?
You have to time your rendering, which is what you are doing in an awkward way with the Sleep instruction. If your target rate is 30 fps, you have to exactly wait 33ms between displaying each frame (which is obtained more or less with your Sleep(25)), but you don't use the Sleep instruction for that !
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what is used to.
|
|
|
|