Skip to content

Windows API

Discussions on the APIs of the various versions of Windows

This category can be followed from the open social web via the handle windows-api@forum.codeproject.com

811 Topics 2.7k Posts
  • WindowFromDC

    question
    3
    0 Votes
    3 Posts
    11 Views
    V
    To get the desktop window handle I use the GetDesktopWindow function. HWND hwndDesktop = GetDesktopWindow()
  • endless WM_MOUSEWHEEL events

    c++ question
    10
    0 Votes
    10 Posts
    24 Views
    S
    You haven't posted any code or shown what any of the "extra" WM_MOUSEWHEEL events you are getting look like and unfortunately, my crystal ball is in the shop, so you might want to post that kind of information. My guess is that its something in your code, but until I see the messages or your code, I can't really give you any advice beyond that. Darn crystal ball shop, they are taking FOREVER to get my ball fixed.
  • printing vertical text using ExtTextOut in memory DC

    graphics performance help
    4
    0 Votes
    4 Posts
    13 Views
    P
    I guess this is a bug, its not uncommon. Especially because the win32 (more maintained) sibling works well.
  • 0 Votes
    1 Posts
    3 Views
    No one has replied
  • Fork Implementation using the native API RtlCloneUserProcess

    c++ com linux json help
    4
    0 Votes
    4 Posts
    14 Views
    L
    Not a word on that function in MSDN. CsrClientCallServer is an undocumented (internal) function, and it's fingerprint may vary without warning. Sorry, can't help here. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] They hate us for our freedom![^]
  • Custom item in context menu

    question lounge
    17
    0 Votes
    17 Posts
    47 Views
    J
    As already noted by Richard, this can't be simply done if there is no method provided like for the Explorer. I will try to explain how context menus are handled: When clicking the right mouse button, the window under the mouse cursor will get a WM_CONTEXTMENU message. When pressing the context menu button on the keyboard (commonly left of the right ctrl key), the window which has the focus will receive this message. The WM_CONTEXTMENU handler will then create and show the menu. This is usually done by loading it from resources. But the complete menu or portions may be also created dynamically by code. It is also common practice to modify resource based menus dynamically according the current context (gray out, remove, add, or change items and sub menus). To modify a menu, you must know the handle that is assigned upon menu creation (with resource based menus the handle of the sub-menu because that contains the items). If you want to insert new items, you must also know about the existing items (order, position, sub menus, separators). If you really want to try it, you must hook the API functions CreateMenu(), CreatePopupMenu(), and TrackPopupMenu[Ex](). But I'm not sure if this will work.
  • setcursorPos mouse_event as administrator.

    question
    3
    0 Votes
    3 Posts
    11 Views
    J
    ok thanks mate. you were of course correct. if anyone cares the problem was i was hooking cbtproc to record mouse events and llkeyboard for keyboard events.this works in user mode but in admin mode HCBTPROC wasnt getting recorded. i swithced it to llmousehook and now its all good. thanks for your help
  • ListView

    css
    3
    0 Votes
    3 Posts
    11 Views
    1
    Thank you :)
  • Help- How WinAPI to call MFC regular DLL ?

    c++ json help question
    2
    0 Votes
    2 Posts
    6 Views
    L
    1. See 2. 2. What is an "API program" 3. Google may be able to. If you are asking how to use a MFC library from a non-MFC program, then I am not sure if that is possible. You would need to ensure that all function calls provide the parameters in the form required by the MFC classes. One of these days I'm going to think of a really clever signature.
  • Looking for a programming language to use

    workspace csharp c++ database
    15
    0 Votes
    15 Posts
    37 Views
    M
    You are probably right. I do have feelings to "nostalgic" things, and VB6 looks more "compact" and less heavy. Usually I work with VS2010 and stick to c++.
  • How to set custom resolution in Windows 7

    tutorial question
    2
    0 Votes
    2 Posts
    8 Views
    L
    Nitin Sawant wrote: My monitor does not display 1024x720 in list The list contains the "supported" resolutions. If the mode isn't listed, the driver will not support it. Your best chance would be an update for the driver. Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
  • 0 Votes
    2 Posts
    8 Views
    L
    As an Admin? From Wikipedia[^]; The default security settings in Windows Vista/Windows 7 disallow non-elevated administrators and all non-administrators from creating symbolic links. This behavior can be changed in the Local Security Policy management console (under: Security Settings\Local Policies\User Rights Assignment\Create symbolic links). It can be worked around by starting cmd.exe with Run as administrator option or the runas command. Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
  • how to get the primary thread ID from a spcified process ID?

    tutorial question
    6
    0 Votes
    6 Posts
    18 Views
    S
    Hello! You can use a combination of CreateToolhelp32Snapshot, Thread32First and Thread32Next functions. Please see this example from MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/ms686852(v=vs.85).aspx[^]
  • getting data from virtual xps printer

    question database com
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • getting data from virtual xps printer

    question csharp database com help
    2
    0 Votes
    2 Posts
    8 Views
    Richard Andrew x64R
    Wouldn't this question be better posted on the frogmorecs site? They know the product. The difficult we do right away... ...the impossible takes slightly longer.
  • SQL Connection problem in Windows Service

    help sysadmin database sql-server workspace
    2
    0 Votes
    2 Posts
    8 Views
    L
    I encountered your question on three different forums. Don't cross-post. Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
  • Windows 8 unsigned DLLs

    question
    8
    0 Votes
    8 Posts
    22 Views
    L
    Guy Davidson wrote: I suspect digital signing is the means by which WRP was achieved Correct. Read the link I posted. Would also explain why there's no "need" for it anymore. Guy Davidson wrote: That's worth sales, believe it or not! It is costing you sales. The reason you are working on Windows and not Macintosh or under AmigaDOS is the fact that it spread and got the most market-share. The people who wouldn't buy it still haven't bought it - (which does not equal a missed sale, that's a jump from a wordsmith) - but within no-time, everyone new the name, everyone complained about MS, and presto - they were the standard. Same story for MS Office and their competition WP, Lotus and DBase. They actively used the strategy to push the Express versions and bumped Borland out of the market. The notion that a gamer would "buy" your game if he can't find a cracked version is plain wrong. We simply played another game, knowing that the other game would be available within a week. The reason that there are few cracked (modern) versions of Delphi available, is because we have a free alternative. It might not be as loaded as the "pro" version, but it's enough for the casual user. I am sorry, but I cannot help here - as you can see, I'm coming from a very different perspective. Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
  • Multithreading and timing with Windows API

    json tutorial question
    2
    0 Votes
    2 Posts
    6 Views
    P
    The first problem is that your thread might be executed by different cores, the OS might switch your thread from one core to another. There are several problems with this: the switch takes time, it might screw up per-core cache efficiency and another problem is that GetPerformanceCounter() uses the tick count of the processor that said to be problematic on some systems if your thread is jumping from one core to another. To force the execution of your thread to a specific core use SetThreadAffinityMask()[^]. With this you might want to force every thread in your program to a specific core to avoid the problems I described above.
  • find and save emails in the yahoo messenger

    question lounge
    2
    0 Votes
    2 Posts
    8 Views
    Richard Andrew x64R
    What does this have to do with the Win32 API? The difficult we do right away... ...the impossible takes slightly longer.
  • 0 Votes
    1 Posts
    3 Views
    No one has replied