Dear all: I am new one in win ce 6.0 driver developement. My question is: 1.How to implement usb touch driver in win ce 6.0? I am not sure implemented touch driver by usb client driver in win ce 6.0 or this way https://msdn.microsoft.com/en-us/library/ms895471.aspx[^] Thank for your help, Victor
cedricvictor
Posts
-
How to implement usb touch driver in win ce 6.0 -
How do I know my dual display in span mode in windows xp?Dear all: I have two touch screens and dual monitor, I try to match touch screen for each monitor in windows xp. I can do it in mirror mode and extended mode, but failed in span mode. I use the EnumDisplayMonitor to get the monitor count, but the monitor count is 1 in span mode. How do I know my dual diplay in span mode and get the monitor count? best regards, Victor
-
Enumdisplaysetting return different display orientation in the same degree with different graphicDear Holguin: I must be knowing the display orientation, so that I can process the absolute coordinate to windows desktop. The Enumdisplaysetting api returns display orientation with different graphic in xp, but same result in win 7. Does anyelse method to judge the display orientation?(same degree, different graphic, but same result) best regards, Victor
-
Enumdisplaysetting return different display orientation in the same degree with different graphicDear all: I use enumdisplaysetting api to get the display orientation. It return different value of the dmDisplayOrientation of DEVMODE structure in the same degree but different graphic. For example: If I rotate the screen in 90 degrees counterclockwise, the api may return 1 with ati graphic, but 3 with nvidia graphic. How to get same result in the same degree with different graphic? Or other method? Best regards, Victor
-
How to get reset status from usb touch device in XP driverHi all: I am new one in wdf. I got a problem. I write a usb hid touch driver in xp(send one touch as mouse). My problem is, when the usb touch device is reset(the reset command are not sent by host), How can I send the reset command from usb touch device to host and notify Os get descriptor again and re addressing? My English is not good, please forgive me. best regard, Victor
-
How to Implement a I2C touch driver in windows xp?Dear all: I am a new one in windows driver, now I want to implement a I2C touch driver in windows xp, Does any sample code in WinDDK? OR anything reference about I2C touch driver? Thanks for your help, Victor
-
How to program a windows xp i2c bus driverDear all: I wanna write a Windows xp i2c bus driver, but I don't know how to begin, and where to search the data, or sample code. Does any one give me some suggestion? Thank for your help. Victor
-
How to write registry after log in windows with mfc?Dear David: I know the filePath equal to C:\Windows\system32. The value of registry which I write is different between log in windows and run windows stable. How can I write the same value in log in windows?
-
How to write registry after log in windows with mfc?Dear Jochen: I use the same code, but different condition. condition 1: windows run stable, it write the registry success with my folder. condition 2: after log in windows, it write the C:\Windows\system32 path. Thanks for your help, Victor.
-
How to write registry after log in windows with mfc?Dear all: I implement a application, when I log in windows, the application will auto start, and write registry in HKEY_CURRENT_USER, SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run. The context of registry is a wav file path. I put the wav file and the application in the same folder. My code show as below:
HKEY hKey = HKEY_CURRENT_USER;
TCHAR filePath[MAX_PATH];
TCHAR dirPath[MAX_PATH];GetCurrentDirectory(MAX_PATH, dirPath);
StringTruncate(filePath, dirPath, "\\Default.wav");
//For ex: filePath may equal C:\abc\123\Default.wav, if my folder path
//is C:\abc\123.WriteReg(hKey, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion"), _T("Sound"), filePath);
My question is: when I log in windows, the registry value always equal to C:\Windows\system32\Default.wav, Not my folder path. How can I write the right wav file path after windows log in? Thanks for your help, Victor.
-
Use PlaySound api caused memory loading?Dear all: I implement a application, when I get a touch data from WM_INPUT and touch count more than previous, it will play sound, My code show as below:
void CTouchSoundTrayDlg::OnRawInput(UINT nInputCode, HRAWINPUT hRawInput)
{
UINT data_size = 0;
BOOL bGot = FALSE;
GetRawInputData(hRawInput, RID_INPUT, NULL, &data_size, sizeof(RAWINPUTHEADER));
vector data;
data.resize (data_size);if(GetRawInputData (hRawInput, RID\_INPUT, &data \[0\], &data\_size, sizeof(RAWINPUTHEADER))!=data\_size) { } RAWINPUT\* raw = (RAWINPUT\*)(&data \[0\]); if (raw->header.dwType == RIM\_TYPEHID) { RID\_DEVICE\_INFO device\_info; UINT info\_size = sizeof(RIDI\_DEVICEINFO); GetRawInputDeviceInfo ( raw->header.hDevice, RIDI\_DEVICEINFO, (LPVOID)&device\_info,&info\_size); if(device\_info.hid.dwVendorId = VENDER\_ID) { g\_CurFrameTime = GetTickCount64(); if(g\_CurFrameTime - g\_PreFrameTime > 30) { g\_PreUsedSize = 0; g\_CurUsedSize = 0; } g\_PreFrameTime = g\_CurFrameTime; DigitizerData\* result = (DigitizerData\*)(raw->data.hid.bRawData); g\_CurUsedSize = result->active\_touch\_count; if(g\_CurUsedSize <= 5) { if(g\_PreUsedSize < g\_CurUsedSize) { PlaySound(m\_WavPath, NULL, SND\_FILENAME|SND\_ASYNC ); } bGot = TRUE; } if(bGot) { g\_PreUsedSize = g\_CurUsedSize; } } } Default();
}
My question is when I touch, it will play sound, and the using memory in task manager will be add, When play music is finish, the using memory is still, will not free ,why? I try to disable the playSound api in my code, and the using memory is stable. Thank your help, Victor
-
How to know no message in WindowProc callback function?Dear all: I use two global variables UINT g_PreUsedSize and g_CurUsedSize in WindowProc callback function. When I touch on my device, I will get WM_INPUT message continuous in WindowProc callback function, and get a result->active_touch_count, and set it to g_CurUsedSize. When I did not touch on my device, I wanna set 0 to g_CurUsedSize.
LRESULT CALLBACK WindowProc (HWND window_handle, UINT message, WPARAM w_param, LPARAM l_param)
{
LRESULT result (0);switch (message)
{
case WM_DESTROY:
PostQuitMessage (0);
break;case WM\_SIZE: { switch (w\_param) { case SIZE\_MAXIMIZED: case SIZE\_RESTORED: { window\_width = (float)(LOWORD (l\_param)); window\_height = (float)(HIWORD (l\_param)); } break; } } break; case WM\_INPUT: { UINT data\_size (0); GetRawInputData ((HRAWINPUT)l\_param, RID\_INPUT,NULL, &data\_size, sizeof (RAWINPUTHEADER)); vector data; data.resize (data\_size); if (GetRawInputData ((HRAWINPUT)l\_param, RID\_INPUT, &data \[0\], &data\_size, sizeof(RAWINPUTHEADER)) != data\_size) { OutputDebugString(TEXT("GetRawInputData does not return correct size !\\n")); break; } RAWINPUT\* raw = (RAWINPUT\*)(&data \[0\]); if (raw->header.dwType == RIM\_TYPEHID) { RID\_DEVICE\_INFO device\_info; UINT info\_size = sizeof(RIDI\_DEVICEINFO); GetRawInputDeviceInfo ( raw->header.hDevice, RIDI\_DEVICEINFO, (LPVOID)&device\_info, &info\_size); if(device\_info.hid.dwVendorId = 0x0457) { DigitizerData\* result = (DigitizerData\*)(raw->data.hid.bRawData); g\_CurUsedSize = result->active\_touch\_count; BOOL bGot = FALSE; if(g\_CurUsedSize <= 5) { if(g\_PreUsedSize < g\_CurUsedSize) { PlaySound(TEXT("C:\\\\default.wav"),NULL, SND\_FILENAME|SND\_ASYNC ); } } bGot = TRUE; } } if(bGot) { g\_PreUsedSize = g\_CurUsedSize; } } } result = DefWindowProc (window\_handle, message, w\_param, l\_param);
}
-
How to use ReadFile API Read HID Device synchronousDear all: I use ReadFile api to read HID device synchronous. My code show as below:
char preUsedSize = 0;
char curUsedSize = 0;while(1)
{
opening_HANDLE = TestHid.ReturnHandle();
BOOL bGot = FALSE;
Data64_t aData64;
DWORD dwBytes = 0;BOOL bSus = ::ReadFile(opening\_HANDLE, aData64.raw, sizeof(aData64), &dwBytes, NULL); if( bSus ) { PTOUCH\_REPORT inputData = (PTOUCH\_REPORT)aData64.raw; curUsedSize = inputData->actualCnt; if(curUsedSize > preUsedSize) { for(int i = 0; i<(curUsedSize - preUsedSize);i++) { Beep(0x7fff, 500); } } preUsedSize = curUsedSize; bGot = TRUE; } else { CloseHandle(opening\_HANDLE); } if(!bGot) { Sleep(500); }
}
My question is how do I clean preUsedSize and curUsedSize to 0, If I did not get any data from my device(not get data failed)? The FALSE of bSus means I get data from HID device fail, not no data income. Thanks for your help, Victor.
-
How to use global hook with WH_GETMESSAGEDear Richard: It mean I just hook message only from application message queue, so I can not get message from anthor place? When I touch on some applications, it works. When I touch on desktop, it does not work. How? Does it mean the touch message on desktop not exist in application message queue? Thanks for your help, Victor
-
How to use global hook with WH_GETMESSAGEDear all: I try to use global hook with WH_GETMESSAGE, but still failed. It work only on my application, not global. My code show as below:
#pragma data_seg (".SHARED")
HHOOK g_hPreviousMsgHook = 0;
HINSTANCE g_hInstance = 0;
#pragma data_seg()
#pragma comment(linker, "/SECTION:.SHARED,RWS")BOOL CSoundDllApp::InitInstance()
{
CWinApp::InitInstance();
g_hInstance = AfxGetInstanceHandle();
return TRUE;
}BOOL InstallWinHook()
{
BOOL bReturn = TRUE;
g_hPreviousMsgHook = SetWindowsHookEx(WH_GETMESSAGE,
&MsgHookProcedure, g_hInstance, 0);if(NULL == g\_hPreviousMsgHook) { bReturn = FALSE; } return bReturn;
}
LRESULT CALLBACK MsgHookProcedure(int nCode, WPARAM wParam, LPARAM lParam)
{
if(0 > nCode)
return CallNextHookEx(g_hPreviousMsgHook, nCode,
wParam, lParam);
PMSG data = (PMSG)lParam;switch(data->message) { case WM\_POINTERDOWN: Beep(0x7fff, 1000); break; } return CallNextHookEx(g\_hPreviousMouseHook, nCode, wParam, lParam);
}
I set 0 into last parameter of setWindowsHookEx api, but it seem like not work. Could someone tell me where's wrong, please? Thanks for your help, Victor
-
How do I using WH_CALLWNDPROC and PT_TOUCH to get the global touch eventDear all: I try to use WH_CALLWNDPROC and PT_TOUCH in dll to get the global touch event. But I get some problems. My code lists as below:
#pragma data_seg (".SHARED")
HHOOK g_hPreviousMouseHook = 0;
HINSTANCE g_hInstance = 0;
#pragma data_seg()
#pragma comment(linker, "/SECTION:.SHARED,RWS")BOOL CSoundDllApp::InitInstance()
{
CWinApp::InitInstance();
g_hInstance = AfxGetInstanceHandle();
return TRUE;
}BOOL InstallWinHook()
{
BOOL bReturn = TRUE;
g_hPreviousMouseHook = SetWindowsHookEx(WH_CALLWNDPROC,
&WinHookProcedure, g_hInstance, 0);if(NULL == g\_hPreviousMouseHook) { bReturn = FALSE; } return bReturn;
}
BOOL UnInstallWinHook()
{
BOOL bReturn = TRUE;
if(UnhookWindowsHookEx(g_hPreviousMouseHook) == FALSE)
{
bReturn = FALSE;
}
return bReturn;
}LRESULT CALLBACK WinHookProcedure(int nCode, WPARAM wParam, LPARAM lParam)
{
if(0 > nCode)
return CallNextHookEx(g_hPreviousMouseHook, nCode,
wParam, lParam);
UINT32 pointerId = GET_POINTERID_WPARAM(wParam);
POINTER_INPUT_TYPE pointerType;if(GetPointerType(pointerId, &pointerType)) { //if (pointerType == PT\_TOUCH) //{ //} } return CallNextHookEx(g\_hPreviousMouseHook, nCode, wParam, lParam);
}
When I disable the GetPointerType(pointerId, &pointerType) in WinHookProcedure, it will load the dll success. When I enable the GetPointerType(pointerId, &pointerType) in WinHookProcedure, it will load the dll failed. what happened? Could someone tell me please? Thanks for your help, Victor
-
About InstallWinIoDriver function of WinIo.dllDear Randor: You are right. In other function, the service is exist. So the function always return false. Thank for your help, Victor
-
About InstallWinIoDriver function of WinIo.dllDear all: I use winIo.dll with my project, when I call InstallWinIoDriver function, it always return false, but my application still work, What happened? There are source code below
bool _stdcall InstallWinIoDriver(PWSTR pszWinIoDriverPath, bool IsDemandLoaded)
{
SC_HANDLE hSCManager;
SC_HANDLE hService;
// Remove any previous instance of the driver
RemoveWinIoDriver();hSCManager = OpenSCManager(NULL, NULL, SC\_MANAGER\_ALL\_ACCESS); if(hSCManager) { // Install the driver hService = CreateService(hSCManager, L"WINIO", L"WINIO", SERVICE\_ALL\_ACCESS, SERVICE\_KERNEL\_DRIVER, (IsDemandLoaded == true) ? SERVICE\_DEMAND\_START : SERVICE\_SYSTEM\_START, SERVICE\_ERROR\_NORMAL, pszWinIoDriverPath, NULL, NULL, NULL, NULL, NULL); CloseServiceHandle(hSCManager); if(hService == NULL) return false; //strange } else return false; //strange CloseServiceHandle(hService); //strange return true; //strange
}
Thanks for your help, Victor
-
How can I use winRing0.dllDear 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
-
How can I use winRing0.dllDear 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.