winapi

Get the line number in Edit control

how can you get the current line number in a multi-line edit control? ...

QT (4) equivalent macros/methods/constants for their Win32 API counterparts?

I am converting some GUI code I originally wrote using the win32 API, to use QT. I have come accross some items for which I cant find any direct equivalents. They are: GetRValue GetGValue GetBValue PS_SOLID PS_DASH PS_DOT PS_DASH_DOT PS_NULL MulDiv HBITMAP Any help? [Edit] I am building on Ubuntu 9.10 ...

Ellipsis do not work for static text in ATL project

Hey folks, I am currently working on an ATL project with a simple UI. In this UI I have a couple of static text controls and I want them to have ellipsis at the end when the text is to long. So I set the word ellipsis property in the designer to true (which also triggers end ellipsis and path ellipsis to true). However during run-time t...

How to detect if HPET is available

Hi, how can I detect (using C++) wether my system has a HPET or not? Thx for your help, Tobias HPET = High Precision Event Timer ...

Absolute path from window handle

Hi All, I open a file in windows word and get a handle to the window. Can I get the absolute path of the file (the actual .doc file, not the winword.exe)? Thanks a lot ...

Invoking the Windows Security Dialog (in C# or VB.NET)

Hi all, first things first this problem has stumped me for about a week and i would love a working answer! I would like to know how to invoke the Windows Security Dialog (press ctrl+alt+del on a windows workstation NOTE: i dont want the task manager!) programatically. ON AN XP WORKSTATION, don't worry about Win7 or Vista Ideally with ...

Send custom information through Windows FileSystem Attributes

Before getting into the point, I'll give you an overview of what I want to do. Because I don't know if using Windows Filesystem attributes is the right option to do that. I have two components in the system. One of them is a ShellExtension that put an OverlayIcon when some condition is satisfied, and the other component is a Filesystem ...

Why does CreateWindowEx return 0

VB.NET 2008 Express Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Integer, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hwndParent As Integer, ByVal h...

QPixmap from QBitmap

I am converting a win32 api graphing library to use the qt library instead. I have managed to compile succesfully on XP, now to test true cross-platform capability of the new and improved graphing library, I am attempting to build it on Ubuntu (9.10). I have encountered a couple of compile time erros - because some of the classes are Wi...

What are the possible reasons the system() function can not find the executable?

if( system("tail -500 log.txt") == -1) { //Error calling tail.exe on log //errno is a system macro that expands int returning //the last error. strerror() converts the error to it's //corresponding error message. printf("Error calling tail.exe with system(): %s",strerror( errno )); } System() is c...

Win32 API timers....

I was using the system timer (clock() function, see time.h) to time some serial and USB comms. All I needed was approx 1ms accurace. The first thing I noticed is that individual times can be out (plus or minus) 10ms. Timing a number of smaller events led to less accurate timing as events went by. Aggregate timing was slightly better. Aft...

Conditional compilation with WISE

I need to adapt existing WISE installers for 64-bit, but don't want to make copies of the existing installers. For future maintenance purposes, I want one project that produces both 32-bit and 64-bit installers. Googling this, I find indications that it's possible, but no straightforward documentation explaining what the correct approa...

Error loading type library/DLL

When I use the following code I get an compilation error #import <dwmapi.lib> #include <dwmapi.h> I get the following error: fatal error C1083: Cannot open type library file: 'c:\program files\microsoft sdks\windows\v7.0a\lib\dwmapi.lib': Error loading type library/DLL. Intellisense says: 2 IntelliSense: cannot open ...

What should COMSPEC and PATH environmental variables be to locate the command-interpreter, using system()?

Are the OS (XP) environmental variables the same used in a process running from visual studio .NET C++? It seems the command interpreter is not found: When using NULL as the command, system() returns 0 and with command - ENOENT Command interpreter cannot be found. In windows (System->Environmental Variables), COMSPEC contains the pa...

How do I install hardware driver using C++ on Win32?

How do I install a hardware driver (inf file) using C++? Platform : Win32 ...

Moving from windows programming to Linux Programming

I'm moving from windows programming (By windows programming I mean using Windows API) to Linux Programming. For programming Windows, the option we have is Win32API (MFC is just a C++ wrapper for the same). I want to know if there is something like Linux API (equivalent to WINAPI) that is exposed directly to the programmer? Where can I...

Color change in Rich Edit Control

when you erase a coloured text. By default, the control sets the new entered text colour back to that was recently erased. how can you avoid that? do you need to check each character style before you type? UPDATE: I'm trying to set the text color like this. SendMessage(hEdit, EM_SETSEL, start_pos, end_pos); //select text for coloring ...

When/why should heapmin be used?

A customer has some memory usage requirements of our application. They note that while our committed memory is reasonable, the reserved memory is high. They suspect this is because the CRT heap grows as we allocate memory, but the CRT isn't returning pages to the OS when the memory is deallocated. We are just using built-in operator ne...

Problem with GetLastError API on windows 7

Hi, I have one application that interacts with the server. If the server is down then then I will get ERROR_WINHTTP_CANNOT_CONNECT I am using getLastError() API to get this error code, I am handling this error code to display proper error messages to the users. This program works fine in Windows 2003. When i tried with Windows7 i am not...

popup not active window gets activated

Hi, I've a popup window which I show with the SW_SHOWNA flag. If I click parts of this window, I catch the click and then close it, the problem is, there are other parts of the window and I don't want to close the window on click on them, but when I click them the window gets activated and gets the focus, that's bad for me, I want this ...