Search Results

Search found 3339 results on 134 pages for 'pure win32'.

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

  • How can i determine the version of the Windows SDK installed on my computer?

    - by NuclearCheese781
    Hello everyone :) I've very recently decided to teach myself c++ and win32 programming after learning vb.net, and i've got a very simple question: How can I determine what version of the Windows SDK is installed on my computer? I'm asking so I can install the latest version if it isn't installed allready, before i start playing around with c++. I'm using Microsoft Visual Studio 2008 SP1 as my IDE. (I spent 10 minutes using Google to search for an answer, but I couldn't find one) If anyone could help me, it would be very much appreciated. Matt.

    Read the article

  • SetParent() on a VB6 application from a C# app

    - by JD
    Aloha all! I am trying to use the win32 API to set the parent of an application to a panel in my C# application. I can get most applications to work... However I have one application which was written in VB6 which I am having problems with... When I inspect it using spy++ the application loads in 2 main forms 'ThunderRT6Main' and 'ThunderRT6MDIForm' both with the same title. I have found the handle of both of these and tried to call SetParent on them both but the window does nothing and does not move anywhere... Is there something funky I need to do when invoking SetParent() on a VB6 app?

    Read the article

  • When using DrawText, what does TextFormatFlags.Internal (a.k.a. DT_INTERNAL) do?

    - by Daniel Stutzbach
    When using TextRenderer.DrawText(), what does setting the TextFormatFlags.Internal flag actually do? Equivalently, what does setting the DT_INTERNAL flag to Win32's DrawTextEx() function do? More to the point, when should I set that flag and when should I not set it? The documentation says: "Uses the system font to calculate text metrics", but I'm not entirely sure what that means. I've done some limited testing and setting the flag seems to change how the font is rendered when using a small font size, but doesn't seem to make a difference when using a large font size.

    Read the article

  • Find which MFC child window would receive a mouse click

    - by tfinniga
    So, I have a plugin to an MFC program. I'm using a mouse event hook (from SetWindowsHookEx) to capture clicks. The host application can have any number of (possibly overlapping) child windows open, but I only want to intercept clicks in a particular child window. Is there a way to figure out in the hook proc which of the child windows would process the click? I guess it's something like enumerate all child windows, looking at Z-order, but I'm very unfamiliar with the MFC/Win32 libraries, and I'm not able to find any good discussion about how to enumerate all children and calculate which is topmost.

    Read the article

  • Windows equivalent of inb(), outb(), low level i/o

    - by Sebastian Dwornik
    I have some Linux code that monitors our hardware by collecting temperatures, voltages, and fan speeds, from the motherboard using inb(), outb(), inl(), etc. low level i/o functions. My challenge is to port that code over to run under Windows as a simple console app. But am puzzled in what functions Win32 (or .NET) provide that allow me permission to access direct memory mapped ports. I don't want to code a system driver either. My Windows tool preference is VS2008. (fyi) Is this possible?

    Read the article

  • How can we manage ProductVersion(A Windows Resource) automatically?

    - by Benjamin
    Windows resources have a FileVersion and a ProductVersion. In native development environment(eg. Win32 app, device driver) How do you manage the ProductVerion automatically? My language is c/c++. And I use Visual Studio 2008. I want to increase the version automatically when I build my projects. Is it possible? I guess there is a simple(and good) way. Thanks in advance.

    Read the article

  • How can you prevent a window being captured by Print-Screen?

    - by John
    I noticed a few times than when I print-screen while Media Player is running, the content is replaced with a grey rectangle. I've no idea if it's deliberate due to DRM, or some technical issue, but it struck me that being able to deliberately block screen-capture might be a useful feature in some scenarios. Is there some specific message each HWND gets for print-screen - does Windows do a special repaint or simply dump buffers to the clipboard? I guess I'd prefer to focus this on Win32 specifically, but as long as it's Windows-related then fine.

    Read the article

  • Getting lpfnAcceptEx (accpetex) to block in native C++

    - by Alikar
    Hello, I've been trying to get the lpfnAcceptEX function in Win32 to block on accept. If this is not possible I was wondering if there was a flag I could accpet or some other function that I could wait on. Right now the program is simply continually creating accepted sockets with no connections behind them. Perhaps I am misunderstanding how this is to work. Is there another function I need to wait on? I am following the example laid out here: http://msdn.microsoft.com/en-us/library/ms737524(VS.85).aspx Thanks, = Alikar

    Read the article

  • Win32 reset event like synchronization class with boost C++

    - by fgungor
    I need some mechanism reminiscent of Win32 reset events that I can check via functions having the same semantics with WaitForSingleObject() and WaitForMultipleObjects() (Only need the ..SingleObject() version for the moment) . But I am targeting multiple platforms so all I have is boost::threads (AFAIK) . I came up with the following class and wanted to ask about the potential problems and whether it is up to the task or not. Thanks in advance. class reset_event { bool flag, auto_reset; boost::condition_variable cond_var; boost::mutex mx_flag; public: reset_event(bool _auto_reset = false) : flag(false), auto_reset(_auto_reset) { } void wait() { boost::unique_lock<boost::mutex> LOCK(mx_flag); if (flag) return; cond_var.wait(LOCK); if (auto_reset) flag = false; } bool wait(const boost::posix_time::time_duration& dur) { boost::unique_lock<boost::mutex> LOCK(mx_flag); bool ret = cond_var.timed_wait(LOCK, dur) || flag; if (auto_reset && ret) flag = false; return ret; } void set() { boost::lock_guard<boost::mutex> LOCK(mx_flag); flag = true; cond_var.notify_all(); } void reset() { boost::lock_guard<boost::mutex> LOCK(mx_flag); flag = false; } }; Example usage; reset_event terminate_thread; void fn_thread() { while(!terminate_thread.wait(boost::posix_time::milliseconds(10))) { std::cout << "working..." << std::endl; boost::this_thread::sleep(boost::posix_time::milliseconds(1000)); } std::cout << "thread terminated" << std::endl; } int main() { boost::thread worker(fn_thread); boost::this_thread::sleep(boost::posix_time::seconds(1)); terminate_thread.set(); worker.join(); return 0; } EDIT I have fixed the code according to Michael Burr's suggestions. My "very simple" tests indicate no problems. class reset_event { bool flag, auto_reset; boost::condition_variable cond_var; boost::mutex mx_flag; public: explicit reset_event(bool _auto_reset = false) : flag(false), auto_reset(_auto_reset) { } void wait() { boost::unique_lock<boost::mutex> LOCK(mx_flag); if (flag) { if (auto_reset) flag = false; return; } do { cond_var.wait(LOCK); } while(!flag); if (auto_reset) flag = false; } bool wait(const boost::posix_time::time_duration& dur) { boost::unique_lock<boost::mutex> LOCK(mx_flag); if (flag) { if (auto_reset) flag = false; return true; } bool ret = cond_var.timed_wait(LOCK, dur); if (ret && flag) { if (auto_reset) flag = false; return true; } return false; } void set() { boost::lock_guard<boost::mutex> LOCK(mx_flag); flag = true; cond_var.notify_all(); } void reset() { boost::lock_guard<boost::mutex> LOCK(mx_flag); flag = false; } };

    Read the article

  • sharepoint 3.0 : access is denied after install

    - by phill
    I just finished install sharepoint 3.0 on a w2k3 enterprise server. It says installation successfully completed. Then when i attempt to go to 'Sharepoint Products and Technologies configuration wizard, i receive the following error: Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you Quit, the application will close immediately. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ***** Exception Text ******* System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex) at Microsoft.SharePoint.Library.SPRequest.OpenWeb(String bstrUrl, String& pbstrServerRelativeUrl, String& pbstrTitle, String& pbstrDescription, Guid& pguidID, String& pbstrRequestAccessEmail, UInt32& pwebVersion, Guid& pguidScopeId, UInt32& pnAuthorID, UInt32& pnLanguage, UInt32& pnLocale, UInt16& pnTimeZone, Boolean& bTime24, Int16& pnCollation, UInt32& pnCollationLCID, Int16& pnCalendarType, Int16& pnAdjustHijriDays, Int16& pnAltCalendarType, Boolean& pbShowWeeks, Int16& pnFirstWeekOfYear, UInt32& pnFirstDayOfWeek, Int16& pnWorkDays, Int16& pnWorkDayStartHour, Int16& pnWorkDayEndHour, Int16& pnMeetingCount, Int32& plFlags, Boolean& bConnectedToPortal, String& pbstrPortalUrl, String& pbstrPortalName, Int32& plWebTemplateId, Int16& pnProvisionConfig, String& pbstrDefaultTheme, String& pbstrDefaultThemeCSSUrl, String& pbstrAlternateCSSUrl, String& pbstrCustomizedCssFileList, String& pbstrCustomJSUrl, String& pbstrAlternateHeaderUrl, String& pbstrMasterUrl, String& pbstrCustomMasterUrl, String& pbstrSiteLogoUrl, String& pbstrSiteLogoDescription, Object& pvarUser, Boolean& pvarIsAuditor, UInt64& ppermMask, Boolean& bUserIsSiteAdmin, Boolean& bHasUniquePerm, Guid& pguidUserInfoListID, Guid& pguidUniqueNavParent, Int32& plSiteFlags, DateTime& pdtLastContentChange, DateTime& pdtLastSecurityChange, String& pbstrWelcomePage) at Microsoft.SharePoint.SPWeb.InitWeb() at Microsoft.SharePoint.SPWeb.get_WebTemplate() at Microsoft.SharePoint.SPEvaluatorModeProvisioning.TryGetIsSiteProvisioned(String template, String relativePath, Nullable`1 port, SPSite& provisionedSite, SPWeb& provisionedWeb, Uri& provisionedUri) at Microsoft.SharePoint.PostSetupConfiguration.WelcomeForm.ShowNextFormForServerRoleSingleServer() at Microsoft.SharePoint.PostSetupConfiguration.WelcomeForm.PsconfigBaseFormNextButtonClickedEventHandler(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ***** Loaded Assemblies ******* mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3607 (GDR.050727-3600) CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- psconfigUI Assembly Version: 12.0.0.0 Win32 Version: 12.0.6500.5000 CodeBase: file:///C:/Program%20Files/Common%20Files/Microsoft%20Shared/web%20server%20extensions/12/BIN/psconfigui.exe ---------------------------------------- System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3614 (GDR.050727-3600) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System.Configuration Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.Xml Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3082 (QFE.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- Microsoft.SharePoint Assembly Version: 12.0.0.0 Win32 Version: 12.0.6535.5003 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SharePoint/12.0.0.0__71e9bce111e9429c/Microsoft.SharePoint.dll ---------------------------------------- Microsoft.SharePoint.SetupConfiguration.Intl Assembly Version: 12.0.0.0 Win32 Version: 12.0.6413.1000 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SharePoint.SetupConfiguration.intl/12.0.0.0__71e9bce111e9429c/Microsoft.SharePoint.SetupConfiguration.intl.dll ---------------------------------------- System.ServiceProcess Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.ServiceProcess/2.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll ---------------------------------------- System.Data Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll ---------------------------------------- Microsoft.SharePoint.Security Assembly Version: 12.0.0.0 Win32 Version: 12.0.4518.1016 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SharePoint.Security/12.0.0.0__71e9bce111e9429c/Microsoft.SharePoint.Security.dll ---------------------------------------- System.Transactions Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll ---------------------------------------- Microsoft.SharePoint.Search Assembly Version: 12.0.0.0 Win32 Version: 12.0.6531.5000 CodeBase: file:///C:/WINDOWS/assembly/GAC_32/Microsoft.SharePoint.Search/12.0.0.0__71e9bce111e9429c/Microsoft.SharePoint.Search.dll ---------------------------------------- msvcm80 Assembly Version: 8.0.50727.3053 Win32 Version: 8.00.50727.3053 CodeBase: file:///C:/WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.3053_x-ww_B80FA8CA/msvcm80.dll ---------------------------------------- System.Web Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3614 (GDR.050727-3600) CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll ---------------------------------------- System.DirectoryServices Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.DirectoryServices/2.0.0.0__b03f5f7f11d50a3a/System.DirectoryServices.dll ---------------------------------------- Microsoft.SharePoint.AdministrationOperation Assembly Version: 12.0.0.0 Win32 Version: 12.0.6500.5000 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SharePoint.AdministrationOperation/12.0.0.0__71e9bce111e9429c/Microsoft.SharePoint.AdministrationOperation.dll ---------------------------------------- System.EnterpriseServices Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll ---------------------------------------- Microsoft.SharePoint.Library Assembly Version: 12.0.0.0 Win32 Version: 12.0.6517.5000 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SharePoint.Library/12.0.0.0__71e9bce111e9429c/Microsoft.SharePoint.Library.dll ***** JIT Debugging ******* To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled. For example: When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box. Any ideas? thanks in advance

    Read the article

  • configuring local W3C validator on xampp - windows xp sp3

    - by Gabriel
    Hi I have no experience on perl. I am trying to configure the W3C validator on my localhost (win32). I have already followed all the instructions given by W3C @http://validator.w3.org/docs/install_win.html, but I am getting the following error: Can't locate loadable object for module Encode::HanExtra in @INC (@INC contains: C:/xampp/perl/lib C:/xampp/perl/site/lib .) at C:/xampp/validator-0.8.6/httpd/cgi-bin/check line 49 Compilation failed in require at C:/xampp/validator-0.8.6/httpd/cgi-bin/check line 49. BEGIN failed--compilation aborted at C:/xampp/validator-0.8.6/httpd/cgi-bin/check line 49. I'm running perl 5.10.1 on xampp and the following HandExtra Module http://cpansearch.perl.org/src/AUDREYT/Encode-HanExtra-0.23/lib/Encode/HanExtra.pm This is C:/xampp/validator-0.8.6/httpd/cgi-bin/check line 49 : use Encode::HanExtra qw(); # for some chinese character encodings if I document that line using # I get a similar message related to other object: Can't locate loadable object for module Sub::Name in @INC (@INC contains: C:/xampp/perl/lib C:/xampp/perl/site/lib .) at C:/xampp/perl/site/lib/Moose.pm line 12 This is Line 12 at Moose.pm : use Sub::Name 'subname'; I don't know how to proceed. I will appreciate any advise. Thanks

    Read the article

  • Aero Snap not working for my application

    - by Magnus Österlind
    I have a problem with Aero Snap not working with the application I'm working on (Windows desktop, native C++ application), and I'm a bit confused as to what's happening, as it seems like it should just work, out of the box. I've used Spy++ on a mininal win32 application, and get the following messages when I press Win-Left: <00070 00030D1C P WM_KEYDOWN nVirtKey:VK_LWIN cRepeat:1 ScanCode:5B fRepeat:0 fUp:0 <00071 00030D1C P WM_KEYDOWN nVirtKey:VK_LWIN cRepeat:1 ScanCode:5B fRepeat:1 fUp:0 <00072 00030D1C P WM_KEYDOWN nVirtKey:VK_LWIN cRepeat:1 ScanCode:5B fRepeat:1 fUp:0 <00088 00030D1C S WM_GETMINMAXINFO lpmmi:0043FCBC <00089 00030D1C R WM_GETMINMAXINFO lpmmi:0043FCBC <00090 00030D1C S WM_WINDOWPOSCHANGING lpwp:0043FCC4 <00091 00030D1C S WM_GETMINMAXINFO lpmmi:0043F8E8 <00092 00030D1C R WM_GETMINMAXINFO lpmmi:0043F8E8 <00093 00030D1C R WM_WINDOWPOSCHANGING .. and so on So I can see that the WM_KEYDOWN for the left key isn't reaching the application, but I'm getting the aero snap "resize window" stuff instead. When I Spy++ my application, I can see that the left key isn't being "intercepted", but instead being passed on to the application, so I don't get any snapping goodness. <00043 000F0F12 P WM_KEYDOWN nVirtKey:VK_LWIN cRepeat:1 ScanCode:5B fRepeat:0 fUp:0 <00044 000F0F12 P WM_KEYDOWN nVirtKey:VK_LWIN cRepeat:1 ScanCode:5B fRepeat:1 fUp:0 <00045 000F0F12 P WM_KEYDOWN nVirtKey:VK_LWIN cRepeat:1 ScanCode:5B fRepeat:1 fUp:0 <00060 000F0F12 P WM_KEYUP nVirtKey:VK_LEFT cRepeat:1 ScanCode:4B fRepeat:0 fUp:1 I'm going to dig into the cores of our message handling and see what's going on, but I'll take all the tips I can get :)

    Read the article

  • nedmalloc: where does mem<fm come from?

    - by Suma
    While implementing nedmalloc into my application, I am frequently hitting a situation when nedmalloc refuses to free a block of memory, claiming it did not allocate it. While debugging I have come up to the point I see a particular condition which is failing, all other (including magic numbers) succeed. The condition is this: if((size_t)mem-(size_t)fm>=(size_t)1<<(SIZE_T_BITSIZE-1)) return 0; On Win32 this seems to be equivalent to: if((int)((size_t)mem-(size_t)fm)<0) return 0; Which seems to be the same as: if((size_t)mem<(size_t)fm) return 0; In my case I really see mem < fm. What I do not understand now is, where does this condition come from. I cannot find anything which would guarantee the fm <= m anywhere in code. Yet, "select isn't broken": I doubt it would really be a bug in nedmalloc, most likely I am doing something wrong somewhere, but I cannot find it. Once I turn debugging features of nedmalloc on, the problem goes away. If someone here understands inner working of nedmalloc, could you please explain to me why is fm <= m?

    Read the article

  • OpenGL bitmap text fails after drawing polygon

    - by kaykun
    Hi, I'm using Win32 and OpenGL to to draw text onto a window. I'm using the bitmap font method, with wglUseFontBitmaps. Here is my main rendering function: glClear(GL_COLOR_BUFFER_BIT); glPushMatrix(); glColor3f(1.0f, 0.0f, 1.0f); glBegin(GL_QUADS); glVertex2f(0.0f, 0.0f); glVertex2f(128.0f, 0.0f); glVertex2f(128.0f, 128.0f); glVertex2f(0.0f, 128.0f); glEnd(); glPopMatrix(); glPushMatrix(); glColor3f(1.0f, 1.0f, 1.0f); glRasterPos2i(200, 200); glListBase(fontList); glCallLists(5, GL_UNSIGNED_BYTE, "Test."); glPopMatrix(); SwapBuffers(hDC); As you can see it's very simple and the only thing that it's supposed to do is draw a quadrilateral and draw the text "Test.". But the problem is that drawing a polygon seems to mess up any text operations I try to do after it. If I place the text drawing functions before the polygon, both the text and the polygon draw fine. Is there something I'm missing here? Any help is appreciated.

    Read the article

  • How do I capture a WinForm window to a bitmap without the caret

    - by Steve Dunn
    I've got window on a WinForm that I want to get the bitmap representation of. For this, I use the following code (where codeEditor is the control I want a bitmap representation of): public Bitmap GetBitmap( ) { IntPtr srcDC = NativeMethods.GetDC( codeEditor.Handle ) ; var bitmap = new Bitmap( codeEditor.Width, codeEditor.Height ) ; Graphics graphics = Graphics.FromImage( bitmap ) ; var deviceContext = graphics.GetHdc( ) ; bool blitted = NativeMethods.BitBlt( deviceContext, 0, 0, bitmap.Width, bitmap.Height, srcDC, 0, 0, 0x00CC0020 /*SRCCOPY*/ ) ; if ( !blitted ) { throw new InvalidOperationException( @"The bitmap could not be generated." ) ; } int result = NativeMethods.ReleaseDC( codeEditor.Handle, srcDC ) ; if ( result == 0 ) { throw new InvalidOperationException( @"Cannot release bitmap resources." ) ; } graphics.ReleaseHdc( deviceContext ) ; graphics.Dispose( ) ; The trouble is, this captures the caret if it's flashing in the window at the time of capture. I tried calling the Win32 method HideCaret before capturing, but it didn't seem to have any effect.

    Read the article

  • WM_NCHITTEST and secondary monitor to left of primary monitor

    - by AlanKley
    The described setup with 2nd monitor to left of primary causes WM_NCHITTEST to send negative values which is apparently not supported according to this post. I have a custom control written in win32 that is like a Group control. It has a small clickable area. No MOUSE events are coming to my control when the window containing the custom control lies on a second monitor to the left of the primary monitor. SPY++ shows WM_NCHITTEST messages but no Mouse messages. When window is moved to primary monitor or secondary monitor is positioned to right of primary (all points are positive) then everything works fine. Below is how the WM_NCHITTEST is handled in my custom control. In general I need it to return HTTRANSPARENT so as not to obscure other controls placed inside of it. Anybody have any suggestions what funky coordinate translation I need to do and what to return in response to WM_NCHITTEST to get Mouse messages translated and sent to my control in the case where it is on a 2nd monitor placed to the left of the primary monitor? case WM_NCHITTEST: { POINT Pt = {LOWORD(lP), HIWORD(lP)}; int i; ScreenToClient (hWnd, &Pt); if (PtInRect (&rClickableArea, Pt)) { return(DefWindowProc( hWnd, Msg, wP, lP )); } } lReturn = HTTRANSPARENT; break;

    Read the article

  • OpenGL Tearing Problem

    - by kaykun
    Hi, I'm using win32 and opengl and I have a window set up with the projection at glOrtho of the window's coordinates. I have double buffering enabled, tested it with glGet as well. My program always seems to tear any primitives that I try to draw on it if it's being constantly translated. Here is my OpenGL initialization function: glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glViewport(0, 0, 640, 480); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, 640, 0, 480, 0, 100); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glDrawBuffer(GL_BACK); glLoadIdentity(); And this is my rendering function, gMouseX and gMouseY are the coordinates of the mouse: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glTranslatef(gMouseX, gMouseY, 0.0f); glColor3f(0.5f, 0.5f, 0.5f); glBegin(GL_TRIANGLES); glVertex2f(0.0f, 128.0f); glVertex2f(128.0f, 0.0f); glVertex2f(0.0f, 0.0f); glEnd(); SwapBuffers(hDC); The same tearing problem occurs regardless of how often the rendering function runs. Is there something I'm doing wrong or missing here? Thanks for any help.

    Read the article

  • Cannot launch 16-bit application anymore

    - by Nick Bedford
    I'm trying to debug and resolve some issues with a Win32 macro application written C++ however I'm having the strangest issue. I have to launch a 16-bit program and then simulate entering data into and have been using ShellExecute for over two years now. I haven't touched this actual code at all, but now it doesn't work. I'm doing ShellExecute(NULL, "open", exe_path.c_str(), NULL, "", SW_SHOWDEFAULT);. This has worked flawlessly for years but all of sudden, it stopped working. It gives me an ACCESS_DENIED error code. I've Googled and apparently this is a pretty common issue with launching 16-bit apps. The workstation XP SP2 environment hasn't changed at all, and it was actually working until I rebuilt a little while ago (I've rebuilt it before many times). The code is inside a window procedure function and when I take it out and launch the program in the WinMain function it works, but the code has to be in the window procedure... I've tried numerous alternatives but they all give the same issue. The biggest issue with this is it was working then all of a sudden decided it wasn't going to with no change to both code and environment! In fact, it was about half way through testing changes that it thought it'd stop working. Please help as I cannot do anything without the program launching. It's the first step in the code that I'm debugging!

    Read the article

  • Destroy process-less console windows left by Visual Studio debug sessions

    - by jon hanson
    A known bug with security update KB978037 can occur with Visual Studio 2003 (and 2008) where sometimes if you restart a debugging session on a console app then the console window doesn't get closed even though the owner process no longer exists. The problem is discussed further here: http://stackoverflow.com/questions/2402875/visual-studio-debug-console-sometimes-stays-open-and-is-impossible-to-close These zombie windows then can not be closed via the Taskbar or via the TaskManager, and typically require a power off/on to get rid of them. Over the period of even a single day you can accumulate quite a few of them, which clog up your TaskBar and are generally annoying. I thought I would knock up a simple C++ Win32 utility to attempt to call DestroyWindow() on these windows by passing the windows handle as a cmd-line argument and converting it to a HWND. I'm converting the handle from a string by parsing it as a DWORD then casting the DWORD to a HWND. This appears to be working as if I call GetWindowInfo() on the handle it succeeds. However calling DestroyWindow() on the handle fails with error 5 (access denied), presumably because the caller process (i.e. my app) doesn't own the window in question. Any ideas as to how I might get rid of the zombie windows, either via the above approach or any other alternative short of rebooting? I'm in a corporate environment so installing/uninstalling updates/service-packs etc isn't an option.

    Read the article

  • Pattern for UI configuration

    - by TERACytE
    I have a Win32 C++ program that validates user input and updates the UI with status information and options. Currently it is written like this: void ShowError() { SetIcon(kError); SetMessageString("There was an error"); HideButton(kButton1); HideButton(kButton2); ShowButton(kButton3); } void ShowSuccess() { SetIcon(kError); std::String statusText (GetStatusText()); SetMessageString(statusText); HideButton(kButton1); HideButton(kButton2); ShowButton(kButton3); } // plus several more methods to update the UI using similar mechanisms I do not likes this because it duplicates code and causes me to update several methods if something changes in the UI. I am wondering if there is a design pattern or best practice to remove the duplication and make the functionality easier to understand and update. I could consolidate the code inside a config function and pass in flags to enable/disable UI items, but I am not convinced this is the best approach. Any suggestions and ideas?

    Read the article

  • Impossible to remove directory

    - by Mark
    Evidently I've never had to delete a directory using win32 sdk before, because its apparently an impossible task. I've tried anything and everything - RemoveDirectory, SHFileOperation with FO_DELETE, etc. Currently I call CreateDirectory in one thread, start another thread, copy some files to this directory in the new thread, then delete all the files in the directory in the new thread, and then back in the original thread that created the directory, try to delete the now empty directory and it fails. The directory really and truly is empty when I try to delete it, but it makes no difference. The whole thread aspect is irrelevant I think because at one point everything was in one thread and it didn't work. I'm currently setting a SecurityAttributes structure on CreateDirectory to grant access to everyone, but it makes no difference. RemoveDirectory in the past has returned '32' on GetLastError, which I believe is Sharing violation. But even if I just try to delete the empty directory from the command line, it refuses saying, "The process cannot access the file because it is being used by another process." until I shut down the entire application that created the directory. (Note: the directory is created in GetTempPath.)

    Read the article

  • Cannot run Python script on Windows with output redirected??

    - by Wai Yip Tung
    This is running on Windows 7 (64 bit), Python 2.6 with Win32 Extensions for Python. I have a simple script that just print "hello world". I can launch it with python hello.py. In this case I can redirect the output to a file. But if I run it by just typing hello.py on the command line and redirect the output, I get an exception. C:> python hello.py hello world C:> python hello.py >output C:> type output hello world C:> hello.py hello world C:> hello.py >output close failed in file object destructor: Error in sys.excepthook: Original exception was: I think I first get this error after upgrading to Windows 7. I remember it should work in XP. I have seen people talking about this bug python-Bugs-1012692 | Can't pipe input to a python program. But that was long time ago. And it does not mention any solution. Have anyone experienced this? Anyone can help?

    Read the article

  • How do I send floats in window messages.

    - by yngvedh
    Hi, What is the best way to send a float in a windows message using c++ casting operators? The reason I ask is that the approach which first occurred to me did not work. For the record I'm using the standard win32 function to send messages: PostWindowMessage(UINT nMsg, WPARAM wParam, LPARAM lParam) What does not work: Using static_cast<WPARAM>() does not work since WPARAM is typedef'ed to UINT_PTR and will do a numeric conversion from float to int, effectively truncating the value of the float. Using reinterpret_cast<WPARAM>() does not work since it is meant for use with pointers and fails with a compilation error. I can think of two workarounds at the moment: Using reinterpret_cast in conjunction with the address of operator: float f = 42.0f; ::PostWindowMessage(WM_SOME_MESSAGE, *reinterpret_cast<WPARAM*>(&f), 0); Using an union: union { WPARAM wParam, float f }; f = 42.0f; ::PostWindowMessage(WM_SOME_MESSAGE, wParam, 0); Which of these are preffered? Are there any other more elegant way of accomplishing this?

    Read the article

  • Deployment of SQL Server: installing a second instance?

    - by Workshop Alex
    Simple problem. I'm working on a Delphi 2007/WIN32 application which now uses MS Access as simple data store. I have to modify it to support SQL Server Express, which is easy. These modifications are working so the application can be deployed using either SQL Server or MS Access. (Whatever the user prefers.) I did consider deploying the whole application together with the SQL Compact but this is not practicak. Using SQL Server Express 2008 instead of 2005 is an option, but also has a few nasty side-effects which we don't want to resolve for now. The problem is deploying the whole project. The installation with SQL Server would need a quiet installation so the user won't notice it. SQL Server is mentioned in the documentation so they know it's there. We just don't want to bother them with technical issues. In most cases, such an installation will go just fine. But what if the user already has an SQL Server (2005) installation which is used for something else? Personally, I would prefer to just install a second instance of SQL Server on their system so it won't conflict with the other installation. (Thus, if they uninstall the other app, the SQL instance will just stay installed.) While SQL Server 2005 and 2008 can be installed on the same system simply by using two different names for the instance, I wonder if it's also possible to install SQL Server 2005 twice on a single system to get two instances. And if possible, how?

    Read the article

  • How do you convert bytes of bitmap into x, y location of pixels?

    - by Jon
    I have a win32 program that creates a bitmap screenshot. I am trying to figure out the x and y coordinates of the bmBits. Below is the code I have so far: UINT32 nScreenX = GetSystemMetrics(SM_CXSCREEN); UINT32 nScreenY = GetSystemMetrics(SM_CYSCREEN); HDC hdc = GetDC(NULL); HDC hdcScreen = CreateCompatibleDC(hdc); HBITMAP hbmpScreen = CreateDIBSection( hdcDesk, ( BITMAPINFO* )&bitmapInfo.bmiHeader,DIB_RGB_COLORS, &bitmapDataPtr, NULL, 0 ); SelectObject(hdcScreen, hbmpScreen); BitBlt(hdcScreen, 0, 0, nScreenX , nScreenY , hdc, 0, 0, SRCCOPY); ReleaseDC(NULL, hdc); BITMAP bmpScreen; GetObject(hbmpScreen, sizeof(bmpScreen), &bmpScreen); DWORD *pScreenPixels = (DWORD*)bmpScreen.bmBits, UINT32 x = 0; UINT32 y = 0; UINT32 nCntPixels = nScreenX * nScreenY; for(int n = 0; n < nCntPixels; n++) { x = n % nScreenX; y = n / nScreenX; //do stuff with the x and y vals } The code seem correct to me but, when I use this code the x and y values appear to be off. Where does the first pixel of bmBits start? When x and y are both 0. Is that the top left, bottom left, bottom right or top right? Thanks.

    Read the article

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