winapi

How to trigger SelectIndexChanged event to VListBox?

Somebody know the VListBox? It is fast to load item to the listbox. But I can't get the SelectIndexChanged Event be triggered by set SelectIndex. Somebody know how to trigger that event by winapi or something else? VlistBox source code is in the page above. ...

Creating multiple MFC dialogs through COM, strange behaviour

Updated: please see this other thread instead, all this COM stuff is not part of the problem. One of our apps has a COM interface which will launch a dialog, e.g: STDMETHODIMP CSomeClass::LaunchDialog(BSTR TextToDisplay) { CDialog *pDlg = new CSomeDialog(TextToDisplay); pDlg->BringWindowToTop(); } For some reason when the COM m...

Why typedef char CHAR

Guys, having quick look in Winnt.h I have discovered that there is a lots of typedefs and one of them is for example CHAR for a char. Why? What was the purpose of these typdefs? Why not use what's already there (char, int etc.)? Thank you. ...

Win32: How to crash?

i'm trying to figure out where Windows Error Reports are saved; i hit Send on some earlier today, but i forgot that i want to "view the details" so i can examine the memory minidumps. But i cannot find where they are stored (and google doesn't know). So i want to write a dummy application that will crash, show the WER dialog, let me cl...

[MFC] Creating multiple dialogs in an MFC app with no main Window, they become children of each other

(title updated) Following on from this question, now I have a clearer picture what's going on... I have a MFC application with no main window, which exposes an API to create dialogs. When I call some of these methods repeatedly, the dialogs created are parented to each other instead of all being parented to the desktop... I have no idea...

Running processes at different times stops events from working - C

Hello, This is a question which follows on from my previously answered question here At first I assumed I had a problem with the way I was creating my events due to the handles for OpenEvent returning NULL, I have managed to find the real cause however I am not sure how to go about it. Basically I use Visual Studio to launch both Proc...

On XP, how do I get the tooltip to appear above a transclucent form?

I have an form with an Opacity less then 1.0. I have a tooltip associated with a label on the form. When I hover the mouse over the label, the tooltip shows up under the form instead of over the form. If I leave the Opacity at its default value of 1.0, the tooltip correctly appears over the form. However, my form is obviously no long...

Using STARTUPINFOEX in CreateProcess

Many places I saw that we can use startupinfoex structure in CreateProcess function. But when I checked the signature is only allowing startupinfo structure. Can anybody please give a snippet how startupinfoex can be used with createprocess function. Thanks in advance.... ...

Dialog created after first becomes unresponsive unless created first?

After creating the initial dialog box that works perfectly fine, I create another dialog box when the Join Game button is pressed. The dialog box is created and show successfully, however I am unable to type in the edit box or even press or exit the dialog. Does anyone understand how to fix this or why it happens? I made sure the dialog ...

How to find working directory which works between different computers. - C

Hello, I am running two processes,Process A is opened by Process B using the following example: createProcessHandle = CreateProcess( TEXT("C:\\Users\Jamie\\Documents\\Application\\Debug\\ProcessA.exe"), TEXT(""), NULL, NULL, FALSE, 0...

notepad++ plugin, C++ API

i am developing a notepad ++ plugin, am using a propertysheet with tabs as my dialog so far i have managed to show the dialog however when i move the dialog notepad freezes i.e. it stops responding, even the plugin stops responding you can get the source-code here (https://sourceforge.net/projects/notepadpluging/files/npp%20tab%20plug...

OpenGL texture not showing up on some computers, problem with auxDIBImageLoad?

I have a simple openGL GUI that has uses a bmp as a texture. The problem is on some computers the texture doesn't show up. But on ones with newer OpenGL drivers it works. How can I make it more compatible. I think the problem may be with auxDIBImageLoad. When I inspect the result, I see the x,y correct, but the data pointer points t...

WINAPI SetLastError versus C++ Keword Throw

What is the difference between the WINAPI SetLastError() and the C++ keyword throw? For example, are SetLastError(5); and throw 5; the same? ...

Hosting a 32bit OCX inside a 64bit process (specifically Flash)

We are in the process of building a 64bit version of our software, but we use Flash player's OCX control to host Flash in our windows. This OCX file is a 32bit build, do you know if it's possible to host this 32bit version of Flash within our 64bit application? ...

How to share classes between DLLs

I have an unmanaged Win32 C++ application that uses multiple C++ DLLs. The DLLs each need to use class Foo - definition and implementation. Where do Foo.h and Foo.cpp live so that the DLLs link and don't end up duplicating code in memory? Is this a reasonable thing to do? [Edit] There is a lot of good info in all the answers and comme...

Programatically check whether a drive letter is a shared/network drive

Hi SO community! I searched a while but found nothing that helped me. Is there a way to check whether a drive letter stands for a shared drive/network drive or a local disc in python? I guess there is some windows api function that gives me that info, but I cant find it. Perhaps there is even a method already integrated in python? What...

How can I output a UTF-8 encoded XML file with unix line-endings from ActivePerl on Windows?

I'm running ActivePerl 5.8.8 on WinXP. I'd like to output an XML file as UTF-8 with UNIX line endings. I've looked at the perldoc for binmode, but am unsure of the exact syntax (if I'm not barking up the wrong tree). The following doesn't do it (forgive my Perl - it's a learning process!): sub SaveFile { my($FileName, $Contents) = ...

Switch statement usage - C

Hello, I have a thread function on Process B that contains a switch to perform certain operations based on the results of an event sent from Process A, these are stored as two elements in an array. I set the first element to the event which signals when Process A has data to send and I have the second element set to the event which ind...

Send Ctrl+Up to a window

I'm trying to send messages to a window that says Ctrl and Up-arrow has been pressed. I've got the basics down, I can send presses of the space key that registeres fine. But I can't seem to get the ctrl+up working. chosen code snippets: [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] static extern IntPtr SendMess...

How to determine if dll file was compiled as x64 or x86 bit using either Delphi or Lazarus

Using either Delphi 2007+ or Lazarus(Win64) I'm looking for a way to determine if a dll is compiled as x64 or x86? ...