Search Results

Search found 1813 results on 73 pages for 'libusb win32'.

Page 16/73 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • WTL Child window event handling

    - by Rushi
    I am developing window application in that I am having 2 child windows on left and right side. I want to handle input events for both windows separately. How to achieve it? My code: class EditorWindow : public DxWindow { public: CSplitterWindow m_vSplit; CPaneContainer m_lPane; CPaneContainer m_rPane; PropertyDialog m_propertyWnd; DECLARE_WND_CLASS(_T("Specific_Class_Name")) BEGIN_MSG_MAP(EditorWindow) MESSAGE_HANDLER(WM_CREATE, OnCreate) MESSAGE_HANDLER(WM_DESTROY, OnDestroy) MESSAGE_HANDLER(WM_LBUTTONDOWN, KeyHandler) MESSAGE_HANDLER(WM_KEYUP, KeyHandler) MESSAGE_HANDLER(WM_LBUTTONDOWN, KeyHandler) END_MSG_MAP() LRESULT OnCreate(UINT, WPARAM, LPARAM, BOOL&) { CRect rcVert; GetClientRect(&rcVert); m_vSplit.Create(m_hWnd, rcVert, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); m_vSplit.SetSplitterPos(rcVert.Width()/1.4f); // from left m_lPane.Create(m_vSplit.m_hWnd); m_vSplit.SetSplitterPane(0, m_lPane); //m_lPane.SetTitle(L"Left Pane"); m_rPane.Create(m_vSplit.m_hWnd); m_vSplit.SetSplitterPane(1, m_rPane); m_rPane.SetTitle(L"Properties"); m_propertyWnd.Create(m_rPane.m_hWnd); //m_vSplit.SetSplitterPane(SPLIT_PANE_LEFT, md.m_hWnd); return 0; } LRESULT OnDestroy( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled ) { PostQuitMessage(0); bHandled = FALSE; return 0; } LRESULT KeyHandler( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled ) { return 0; } };

    Read the article

  • LogonUser -> CreateProcessAsUser from a system service

    - by Josh K
    I've read all the posts on Stack Overflow about CreateProcessAsUser and there are very few resolved questions, so I'm not holding my breath on this one. But it seems like I'm definitely missing something, so it might be easy. The target OS is Windows XP. I have a service running as "Local System" from which I want to create a process running as a different user. For that user, I have the username and password, so LogonUser goes fine and I get a token for the user (in this case, an Administrator account.) I then try to use that token to call CreateProcessAsUser, but it fails because that token does not come with SeAssignPrimaryTokenPrivilege - however, it does have SeIncreaseQuotaPrivilege. (I used GetTokenInformation to dump all the privileges associated with that token.) According to the MSDN page for CreateProcessAsUser, you need both privileges in order to call CreateProcessAsUser successfully. It also says you don't need the SeAssignPrimaryTokenPrivilege if the token you pass in to CreateProcessAsUser() is a "restricted version of the calling process' primary token", which I can create with CreateRestrictedToken(), but then it will be associated with the Local System user and not the target user I'm trying to run the process as. So how would I create a logon token that is both a restricted version of the calling process' primary token, AND is associated with a different user? Thanks! Note that there is no need for user interaction in here - it's all unattended - so there's no need to do stuff like grabbing WINSTA0, etc.

    Read the article

  • Safely remove window subclassing?

    - by Vegard Larsen
    I am trying to subclass the currently focused window on a Windows system using a global CBT hook. This is related to what happens in this question, but the bug is different. What happens when this subclassing is in effect, is that Opera's (version 10.50) main window is prevented from displaying. Opera has a "splash screen" where you are required to click "Start" for the main window to show that appears after Opera has not shut down properly. Whenever this window pops up, Opera's main window won't show. If Opera was shut down properly, and this splash screen does not show, the main window displays as it should. HHOOK hHook; HWND hWndSubclass = 0; void SubclassWindow(HWND hWnd) { Unsubclass(); FARPROC lpfnOldWndProc = (FARPROC)SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LPARAM)SubClassFunc); SetProp(hWnd, L"PROP_OLDWNDPROC", lpfnOldWndProc); hWndSubclass = hWnd; } void Unsubclass() { if (hWndSubclass != 0 && IsWindow(hWndSubclass)) { FARPROC lpfnOldWndProc = (FARPROC)GetProp(hWndSubclass, L"PROP_OLDWNDPROC"); RemoveProp(hWndSubclass, L"PROP_OLDWNDPROC"); SetWindowLongPtr(hWndSubclass, GWLP_WNDPROC, (LPARAM)lpfnOldWndProc); hWndSubclass = 0; } } static LRESULT CALLBACK SubClassFunc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { if (message == WM_MOVING) { // do something irrelevant } else if (message == WM_DESTROY) { Unsubclass(); } FARPROC lpfnOldWndProc = (FARPROC)GetProp(hWndSubclass, L"PROP_OLDWNDPROC"); return CallWindowProc((WNDPROC)lpfnOldWndProc, hWndSubclass, message, wParam, lParam); } static LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam) { if (nCode == HCBT_SETFOCUS && hWndServer != NULL) { SubclassWindow((HWND)wParam); } if (nCode < 0) { return CallNextHookEx(hHook, nCode, wParam, lParam); } return 0; } BOOL APIENTRY DllMain( HINSTANCE hInstance, DWORD Reason, LPVOID Reserved ) { switch(Reason) { case DLL_PROCESS_ATTACH: hInst = hInstance; return TRUE; case DLL_PROCESS_DETACH: Unsubclass(); return TRUE; } return TRUE; } My suspicion is that Opera's main window is somehow already subclassed. I imagine the following is happening: The window is created with it's own basic WndProc, and is given focus My application subclasses the window, storing the original WndProc Opera subclasses its own window When the window loses focus, I restore the original WndProc, thus ignoring the second WndProc Can this really be the case? Are there any other explanations?

    Read the article

  • How to use Watin 64-bit with MSIE 32-bit

    - by dontomaso
    Hi, I have a C#-application running on Windows 7. I am using Watin to test some flash and quicktime movies in Internet Explorer. I am running in x64 mode due to some memory limitations I encountered in x86-mode. So I run my application which uses Watin, which starts MSIE. Watin starts the 64-bit version of MSIE. So far so good. The problem is, flash and quicktime do not seem to work in MSIE 64-bit, so testing playing of movies will not work. What must be done to run my C# application in 64-bit mode but to get Watin to run MSIE in 32-bit mode?

    Read the article

  • Manifest or Theme/Style for a IWebBrowser2 control?

    - by Bob
    The IWebBrowser2 control has password edit boxes which are squares. This happened many years ago if you were on an XP machine, and you had a password edit field without a manifest file, you would get squares (no character found for the * they put in there with that font). My application has a manifest file. However I don't know how to give a manifest or set the theme or style of the control that is created. Any ideas? Thanks!

    Read the article

  • WM_POWERBROADCAST handler for CMainDlg in ATL app not invoked

    - by psychotik
    I have an ATL app where I want to handle WM_POWERBROADCAST. I have a CMainDlg (CAxDialogImpl) in whose MSG_MAP I defined the handler. BEGIN_MSG_MAP(CMainDlg) ... MESSAGE_HANDLER(WM_POWERBROADCAST, OnPowerChange) ... END_MSG_MAP() However, the handler isn't invoked when I do things that should invoke it, for instance change power settings or put the machine to sleep. Any ideas about what might be going on, and how to fix this? Does CMainDlg not get notified of power events, for some reason?

    Read the article

  • How can I detect message boxes popping up in another process?

    - by Frerich Raabe
    I'd like to execute some code whenever a (any!) message box (as spawned by the MessageBox Function) is shown in another process. I didn't start the process I'm monitoring. I can think of three approaches: Install a global CBT Hook procedure which tells me whenever a window is created on the desktop. Then, check whether the window belongs to the process I'm monitoring and whether the class name is #32770 (which is the class name of dialogs according to the About Window Classes page at the MSDN). This would probably work, but it would pull the DLL which contains the hook procedure into virtually every process on the desktop, and the hook procedure gets called a lot. It smells like a potential perfomance problem. Try to subclass the #32770 system window class (is this possible at all?) and look for WM_CREATE messages in my custom window procedure. Intercept the MessageBox Function API call (even though the remote process is running already!) and call my code from the hook function. So far, I only know that the first idea is feasible, but it seems really inefficient. Can anybody think of a simpler solution than that to this problem?

    Read the article

  • Hide an access violation on another application

    - by Fernando
    Hi, I have an application that sometimes causes an access violation on exit. This is quite unpredictable and all attempts to locate the bug have been unsuccesful so far. The bug is harmless, as no data is lost, so I was thinking if it might be possible to just hide it. Is it possible to have another app launch the buggy one and catch the Access Violation exception if it occurs? If yes, how? Thanks in advance!

    Read the article

  • What is the PIXELFORMATDESCRIPTOR parameter in SetPixelFormat() used for?

    - by Mads Elvheim
    Usually when setting up OpenGL contexts, I've simply filled out a PIXELFORMATDESCRIPTOR structure with the necessary information and called ChoosePixelFormat(), followed by a call to SetPixelFormat() with the returned matching pixelformat from ChoosePixelFormat(). Then I've simply passed the initial descriptor without giving much thought of why. But now I use wglChoosePixelFormatARB() instead if ChoosePixelFormat() because I need some extended traits like sRGB and multisampling. It takes an attribute list of integers, just like XLib/GLX on Linux, not a PIXELFORMATDESCRIPTOR structure. So, do I really have to fill in a descriptor for SetPixelFormat() to use? What does SetPixelFormat() use the descriptor for when it already has the pixelformat descriptor index? Why do I have to specify the same pixelformat attributes in two different places? And which one takes precedence; the attribute list to wglChoosePixelFormatARB(), or the PIXELFORMATDESCRIPTOR attributes passed to SetPixelFormat()? Here are the function prototypes, to make the question more clear: /* Finds a best match based on a PIXELFORMATDESCRIPTOR, and returns the pixelformat index */ int ChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR *ppfd); /* Finds a best match based on an attribute list of integers and floats, and returns a list of indices of matches, with the best matches at the head. Also supports extended pixelformat traits like sRGB color space, floating-point framebuffers and multisampling. */ BOOL wglChoosePixelFormatARB(HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats ); /* Sets the pixelformat based on the pixelformat index */ BOOL SetPixelFormat(HDC hdc, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd);

    Read the article

  • Debugging MinGW program with gdb on Windows, not terminating at assert failure

    - by devil
    How do I set up gdb on window so that it does not allow a program with assertion failure to terminate? I intend to check the stack trace and variables in the program. For example, running this test.cpp program compiled with MinGW 'g++ -g test.cpp -o test' in gdb: #include <cassert> int main(int argc, char ** argv) { assert(1==2); return 0; } Gives: $ gdb test.exe GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-mingw32"... (gdb) r Starting program: f:\code/test.exe [New thread 4616.0x1200] Error: dll starting at 0x77030000 not found. Error: dll starting at 0x75f80000 not found. Error: dll starting at 0x77030000 not found. Error: dll starting at 0x76f30000 not found. Assertion failed: 1==2, file test.cpp, line 2 This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Program exited with code 03. (gdb) I would like to be able to stop the program from terminating immediately, like how Visual Studio's debugger and gdb on Linux does it. I have done a search and found some stuff on trapping signals but I can't seem to find a good post on how to set up gdb to do this.

    Read the article

  • Is it possible to change HANDLE that has been opened for synchronous I/O to be opened for asynchrono

    - by Martin Dobšík
    Dear all, Most of my daily programming work in Windows is nowadays around I/O operations of all kind (pipes, consoles, files, sockets, ...). I am well aware of different methods of reading and writing from/to different kinds of handles (Synchronous, asynchronous waiting for completion on events, waiting on file HANDLEs, I/O completion ports, and alertable I/O). We use many of those. For some of our applications it would be very useful to have only one way to treat all handles. I mean, the program may not know, what kind of handle it has received and we would like to use, let's say, I/O completion ports for all. So first I would ask: Let's assume I have a handle: HANDLE h; which has been received by my process for I/O from somewhere. Is there any easy and reliable way to find out what flags it has been created with? The main flag in question is FILE_FLAG_OVERLAPPED. The only way known to me so far, is to try to register such handle into I/O completion port (using CreateIoCompletionPort()). If that succeeds the handle has been created with FILE_FLAG_OVERLAPPED. But then only I/O completion port must be used, as the handle can not be unregistered from it without closing the HANDLE h itself. Providing there is an easy a way to determine presence of FILE_FLAG_OVERLAPPED, there would come my second question: Is there any way how to add such flag to already existing handle? That would make a handle that has been originally open for synchronous operations to be open for asynchronous. Would there be a way how to create opposite (remove the FILE_FLAG_OVERLAPPED to create synchronous handle from asynchronous)? I have not found any direct way after reading through MSDN and googling a lot. Would there be at least some trick that could do the same? Like re-creating the handle in same way using CreateFile() function or something similar? Something even partly documented or not documented at all? The main place where I would need this, is to determine the the way (or change the way) process should read/write from handles sent to it by third party applications. We can not control how third party products create their handles. Dear Windows gurus: help please! With regards Martin

    Read the article

  • How to simulate mousemove event from one window to another?

    - by Gohan
    Hello, I am trying to Create an empty window, which process the WM_MOUSEMOVE message in WinProc: case WM_MOUSEMOVE: { HWND otherHwnd = HWND(0x000608FC); POINT pt = {LOWORD(lParam), HIWORD(lParam)}; ClientToScreen(otherHwnd, &pt); PostMessage(otherHwnd, WM_TIMER, WPARAM(4096), 0); PostMessage(otherHwnd, message, wParam, lParam); SendMessage(otherHwnd, WM_NCHITTEST, NULL, (LPARAM)MAKELONG(pt.x, pt.y)); SendMessage(otherHwnd, WM_NCHITTEST, NULL, (LPARAM)MAKELONG(pt.x, pt.y)); SendMessage(otherHwnd, WM_NCHITTEST, NULL, (LPARAM)MAKELONG(pt.x, pt.y)); SendMessage(otherHwnd, WM_SETCURSOR, WPARAM(otherHwnd), (LPARAM)MAKELONG(HTCLIENT, WM_MOUSEMOVE)); break; } I hope I can hover the hyberlink in IE, but result is the hyberlink only be showed as hover style in a very short time, then it turn to normal, and then again hover, then normal. At www.amazon.com, when I simulate to hover the link("Today's Deals ") , the link is blinking. I think there is a better way to do it, even the IE window is covered with some other windows, it can make the IE act with the mouseevent. waiting for the best solution~ orz Above is the spy++ logs when I realy hover the link. and the simulate is as same as the real message <01277> 000608FC S WM_SETCURSOR hwnd:000608FC nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE <01278> 000608FC R WM_SETCURSOR fHaltProcessing:False <01279> 000608FC P WM_MOUSEMOVE fwKeys:0000 xPos:406 yPos:50 <01280> 000608FC P WM_TIMER wTimerID:4096 tmprc:00000000 <01281> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01282> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01283> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01284> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01285> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01286> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01287> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01288> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01289> 000608FC S WM_SETCURSOR hwnd:000608FC nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE <01290> 000608FC R WM_SETCURSOR fHaltProcessing:False <01291> 000608FC P WM_MOUSEMOVE fwKeys:0000 xPos:406 yPos:50 <01292> 000608FC P WM_TIMER wTimerID:4096 tmprc:00000000 <01293> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01294> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01295> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01296> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01297> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01298> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01299> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01300> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01301> 000608FC S WM_SETCURSOR hwnd:000608FC nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE <01302> 000608FC R WM_SETCURSOR fHaltProcessing:False <01303> 000608FC P WM_MOUSEMOVE fwKeys:0000 xPos:406 yPos:50 <01304> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01305> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01306> 000608FC P WM_TIMER wTimerID:4096 tmprc:00000000 <01307> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01308> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01309> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01310> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01311> 000608FC S WM_NCHITTEST xPos:521 yPos:281 <01312> 000608FC R WM_NCHITTEST nHittest:HTCLIENT

    Read the article

  • moving SDL video surface

    - by runrunraygun
    Does anyone know how to move my SDL.net video surface around the screen programtically? Surface videoContext = Video.SetVideoMode(1024, 768, 32, false, false, false, true, true); var a = System.Windows.Forms.Control.FromHandle(Video.WindowHandle); var b = System.Windows.Forms.NativeWindow.FromHandle(Video.WindowHandle); I can't find any properties in Surface or Video which do the job, and FromHandle is returning Null. The window is initializing falling off the bottom of the screen. Any ideas?

    Read the article

  • WOW64: get x64 %CommonProgramFiles% from 32 bit process

    - by peterchen
    Queries I tried: ExpandEnvironmentStrings("%COMMONPROGRAMFILES%"), GetSpecialPath(CSIDL_PROGRAM_FILES_COMMON). All resolve to (typically) c:\\Program Files (x86)\\Common Files from my 32 bit app. I need to check a file version installed (typically) under c:\\Program Files\\Common Files of a 643 bit application.

    Read the article

  • How do I render the scrollable regions of a canvas with IViewObject::Draw?

    - by nirvdrum
    Hi, I've been trying to render the entire canvas in an IWebBrowser2 control to a bitmap. IViewObject::Draw seems to be the most promising approach, but I can't get it to render anything that would requires a scroll to show. While I could automate the scrolling and stitch the images together, this would look weird with any fixed position elements. Is this even doable? Additionally, I've tried to set the controller's size to one that would allow the entire contents to display without needing to scroll, but Windows caps the max size to the current screen resolution, so that only gets me partially there. Any help would be much appreciated. I'm currently doing this in the context of Win7 and IE8, but I don't think that should matter much.

    Read the article

  • Ruby Hide Console

    - by Ell
    I am attempting to make a game written in Ruby using the Gosu library (http://www.libgosu.org/) but when I run the game, a console also shows. How do I make sure the console is hidden from the start? thanks in advance, ell

    Read the article

  • Multilangual Unicode rendering in opengl

    - by sum1stolemyname
    Hi Folks, I have to extend an OpenGL-Rendering System to support international characters (especially Hebrew, Arabic and cyrillic). Development Platform is Windows(XP|Vista|7), Alas using Embercardero Delphi 2010. I currently use wglOutLineFont(...) to build my font's display list and glCallLists(length(m_Text), UNSIGNED_SHORT, PWchar(m_Text) ) to render my strings. While this is feasable for Latin-1 Characters, building the full unicode character set in advanced is pretty time-consuming (about 8.5 minutes on my machine), so i am looking for a more efficient solution. I thought about limiting the range from u+0020 - u+077f (latin, greek, cyrillic, arbaic and hebrew) to include just the glyphs i need, but that would just be a solution for my current needs, and will become insufficent once other encoding is needed. On the upside, i do not have to worry about left-to right or right-to left direction as our application can handle this already. I would expect this to be a well-known problem, so i would like to ask if there is any reference material on this on the web, or if you could share some insight on this?

    Read the article

  • Creating a UAC like environment

    - by Rohit
    I want to create an environment like UAC. i.e. my dialog should appear to the user and unless he responds to it, i want to disable the background. User should not be able to carry out any activity. For this purpose I created a new desktop and display my dialog on the new desktop. But i want something like UAC where the background seems disabled (or transparent??). Does anyone know how to go about it? Thanks Rohit

    Read the article

  • GetVersionEx Not Working on Windows 7?!

    - by Andreas Rejbrand
    On my Windows 7 system, the GetVersionEx Windows API function returns "6.0", indicating Windows Vista, when it should return "6.1". If it matters, I used the following Delphi code: function winver: string; var ver: TOSVersionInfo; begin ver.dwOSVersionInfoSize := SizeOf(ver); if GetVersionEx(ver) then with ver do result := IntToStr(dwMajorVersion) + '.' + IntToStr(dwMinorVersion) + '.' + IntToStr(dwBuildNumber) + ' (' + szCSDVersion + ')'; end; and the string "6.0.6002 (Service Pack 2)" was returned. Isn't this highly odd?

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >