winapi

Implement SSL with SSPI: How to start?

Hi, I want to implement an SSL client using SSPI. Where can I find step-by-step guides, code examples, etc.? Thanks in advance. ...

how to set the tab order for the UI controls in win 32?

hello all I have a small dialog which I created dynamically, which has a textbox and a button..if the user presses the TAB key it has to switch between the two control(textbox and button)...I tried using SetwindowPos...but it doesnt seem to solve my problem...please give me a solution for this..in the below code..I also tried to include ...

GetShortPathNameA not working in C#

I'm trying to get get the short filename from a long filename but I'm having problem in c# code. VB.Net code is: Declare Function GetShortPathName Lib "kernel32" _ Alias "GetShortPathNameA" (ByVal lpszLongPath As String, _ ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long Public Function GetShortName(ByVal sLongFi...

How can I enable Vista/Win 7 theming/style for a ToolTip control?

In Windows Vista and Windows 7, ToolTips have a new visual style or theme, they are shiny grey metallic. How can I enable the new style for a ToolTip control? Some controls, like ListViews and ToolBars, use the new tooltips automatically, but other tooltips are rendered with the old yellow XP style. I've tried sending an TTM_SETWINDOW...

check item in popupmenu

i call popumemu(list of checkboxes in another program) using code like: PostMessage(Wnd,WM_RBUTTONDOWN,0,0x0); PostMessage(Wnd,WM_RBUTTONUP,0,0x0); and i can get the HWND of popupmenu window how to check(uncheck) item at certain item? without sending code: SendMessage( TMP,WM_KEYDOWN, VK_DOWN, 0); SendMessage( TMP,WM_KEYUP,...

How do I know which DLL a syscall belongs to?

I have a long list of all the calls a program I have does. What i need to know is which DLL each call belongs to. How would I find this out? Thanks, ...

How do I get a list of functions defined in a DLL?

Assuming I have a list of DLL's an executable loads, How do I get a list of all the functions defined by those DLL's? EDIT: preferably without the use of GUI's or huge programs like Visual Studio Thanks, ...

Does OpenProcess always write lock the file?

I want to call the Windows API OpenProcess function on another process running on the machine. Will this always cause the file whose process I am opening to be write locked? Or does it depend on the access rights I request? ...

Why does this crash?

I've been banging my head...I can't pretend to be a C++ guy... TCHAR * pszUserName = userName.GetBuffer(); SID sid; SecureZeroMemory(&sid, sizeof(sid)); SID_NAME_USE sidNameUse; DWORD cbSid = sizeof(sid); pLog->Log(_T("Getting the SID for user [%s]"), 1, userName); if (!LookupAccountName(NULL, (LPSTR)pszUserName, &sid, &cbSid, NUL...

How to get the idle time in Windows XP using VBA?

I would like to know the current idle time from user input on a given Windows XP machine programmatically. I am using VBA in MS Access. What options do I have? ...

How to embed mp3 into .exe file & Play it?

I am used to embed WAV into .exe and Play it using PlaySound(). However, using this method causes the .exe to become pretty big. Is it possible to do the same with MP3 files and how to do it? I have taken a look at DirectShow but it seems to be able to play from files only? I am developing for Windows Mobile 6 Series ...

I need to know the x and y coordinates of the button click when a WM_COMMAND is activated.

I have a button created with //Create Compass HWND hWndCompass = CreateWindowEx(NULL, "BUTTON", "Compass", WS_TABSTOP|WS_VISIBLE|WS_CHILD|BS_DEFPUSHBUTTON, 600, 10, 50, 24, hWnd, (HMENU)IDC_COMPASS, GetModuleHandle(NULL), NULL); I will add the picture in the future but I need to know where on the button they clicked so I ...

Get DC & RC from new desktop

Hello. I create new desktop with CreateDesktop and want to get it's DC & RC. RECT deskRC; HDC deskDC; HDESK hNewDesktop = CreateDesktop(...); GetWindowRect(hNewDesktop, &deskRC); deskDC = GetDC(hNewDesktop); This returns only 0's. What's the problem? Or maybe there's another way of obtaining those values. P.S.: Deskto...

Alternatives to NtQueryInformationProcess for detecting undead processes?

I'd like to detect when someone terminates a suspended debugged process without informing the debugger. (For example, get to a breakpoint in a console app, and close the app's console window.) The process goes into a zombie-like state and cannot be interacted with further until the debugger releases its hold. This state appears to set t...

in gdi, how to clear the background color of DC. so, the drawed text will show no background color.

when i draw text use DC, it always show an backgournd color which is diffrent from window's background. ...

Importing a DllMain winapi .dll into Visual Studio project C++

I have the .def file, .lib file, the .dll, the source files. It's using WINAPI DllMain, all its functions follow that. It's like this: BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { return TRUE; } extern "C" { int WINAPI DoSomething()...

how to fill gradient for roundrect in pure gdi (not gdi+)

just in pure gdi. thoughts or code are all welcome. ...

MFC/CCriticalSection: Simple lock situation hangs

I have to program a simple threaded program with MFC/C++ for a uni assignment. I have a simple scenario in wich i have a worker thread which executes a function along the lines of : UINT createSchedules(LPVOID param) { genProgThreadVal* v = (genProgThreadVal*) param; // v->searcherLock is of type CcriticalSection* while(1) { ...

I have 2 identical HID USB devices, each one has it's own control program, how can each program know which HID device is theres?

Is there a way to assign one HID device to a program and then another identical HID device to another program without each of them grabbing randomly the first HID device they enumerate? I'd need some kind of unique identifier. Is there such thing? On windows xp/vista/7. ...

A device specific alpha bitmap fails after switching resolutions in remote desktop

All my alpha bitmaps, created using CreateCompatibleBitmap(..), start to receive an error code 87 after someone signs in with Remote Desktop. I am assuming that this is because the resolution changed and I am using a device specific bitmap. I am wondering what the best route is to fix this issue without migrating to a device independen...