winapi

How to make a win32 text box scroll like an iPhone

I'm making a program in win32 for the Windows Mobile platform (testing on WM6.1). Most of the main window consists of a single text box, and I would like to use my finger to scroll it instead of selecting the text. How would I go about doing that? ...

How to load a Windows icon using a pixel buffer?

Hi, I'm trying to create a Windows-compatible icon using a pixel buffer. The Surface class loads an image and saves it as an unsigned int array internally (0xRRGGBB). I'm trying to create an icon like so: Surface m_Test("Data/Interface/CursorTest.png"); HICON result = CreateIconFromResourceEx( (PBYTE)m_Test.GetBuffer(), ...

Can you create a start-up window in console program?

I want to a create dialog box like window before displaying the console window. I haven't actually tried anything yet but was just wondering if it can be displayed as a start-up window. ...

Windows programming for Unix programmer

I am looking for an introduction to Windows programming. I already have some experience with .net-programming using C#, now I want an overview of the lower-level APIs of Windows. Wikipedia has an article on this subject but, it is quite terse. Is there a canonical book or web site for this kind of information? ...

Mixing Win32 SEH with heap-allocated stack frames

Is there a way to escape the "one big stack" model of Win32 without crippling SEH? I'd like to be able to allocate stack frames on the heap, as a way to implement coroutines. However, my code is currently depending on SEH, and this article, a few pages down, says (relating to traversal of exception handlers, scanning, emphasis mine): ...

Screen is flickering even when using doublebuffering

I am totally new in programming. For my first programm I tried to make a small game in c with windows api. the following code is a nearly working snake, (some bugs not fixed yet) but i cant find a working solution to fix that flickering. (I dont know double Buffering so I just took from here: [http://www.codeguru.com/forum/archive/index....

How do I get a string description of a Win32 crash while in Top level filter (I am looking for the address of the instruction at the top of the stack)

If I use a class/method like the one described here how can I get the description/address of the call at the top of the stack? Basically I want some value I can use in a call to our bug tracking system. I want to "uniquely" identify based on the address of the instruction that caused the exception. (It is usually something of the form...

Equivalent for TzSpecificLocalTimeToSystemTime() on win2k?

One of our developers used this call: TzSpecificLocalTimeToSystemTime() but unfortunately we cannot keep it as the code must work on Win2K as well. What alternatives are there for similar functionality? ...

How do I make a custom system wide mouse cursor animation?

I write software for the disabled. One of the problems is difficulty tracking the mouse pointer. I want to have the mouse cursor glow (or similar effect. Maybe water like ripples around it) when the user needs to locate it. How is this done? I know it's possible because it's used in a variety of software. ...

SetTimer dependent on WS_EX_COMPOSITED?

Strange one here: I've got a window created with an extended style of WS_EX_OVERLAPPEDWINDOW | WS_EX_COMPOSITED. On WM_SIZE I create (or reset) a timer using SetTimer, which calls a draw function after a 100 ms pause in resizing (Helps smooth resize.) That's working just fine, but I just noticed that if I remove the WS_EX_COMPOSITIED s...

Moving the Text drawn by TextOut() Function

I'm trying to redraw some text I drew on window at x and y coordinates say (100, 100) to a new location (500, 500). when I redraw the text, it doesn't erase the old text at (100, 100) until I refresh the window (like do a minimize and maximum). how can you update the window to display the current text? ...

Global variable is changed, but memory breakpoint is not hit

I have a bool variable which should be true, but is sometimes set to false. I have set a memory breakpoint to see what is changing that. To my surprise, the breakpoint did not hit, but the variable went to false again. What could change the memory without memory breakpoint catching it? ...

DLGTEMPLATE gui editor as a library or a component

I'm looking for a Windows (pure DLGTEMPLATE output no .net resources!) dialog template editor (as a library or component) that can be used to modify or/and create new dialog templates for DialogBoxIndirect() function. ...

Windows Game Loop 50% CPU on Dual Core

The game loop alone is using 50% of CPU Usage, I haven't done any rendering work yet. What i'm doing here? while(true) { if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)) { if(msg.message == WM_QUIT || msg.message == WM_CLOSE || ms...

Is there a way to get an event from windows on every new process that is started?

Hi I want to get a notification each time a new process is started by the operating system. Note that I need to that in native code (I know it can be done in managed code using System.Management members). Extra points if there is a way to get it before the process starts running :) (i.e in during its initialization) Thanks. ...

How to group Windows API constants

When defining Windows API const values, is it better to have them as const public const int SW_HIDE = 0; public const int SW_SHOWNORMAL = 1; public const int SW_NORMAL = 1; public const int SW_SHOWMINIMIZED = 2; public const int SW_SHOWMAXIMIZED = 3; public const int SW_MAXIMIZE = 3; public const int SW_SHOWNOACTIVATE = 4; public const ...

Get selected font size/style

What API call is there to get the current front size and style of text? for example, If selected font is DEFAULT_GUI_FONT how would you know its size and style (Bold, Italic etc.)? ...

Is there any way to trace through the execution of a batch file?

I inherited some large batch files, and I'd like to rewrite them to a more "developer friendly" language. I'd like to find out the following things: what other scripts it calls what other processes it starts what files does it write to what environment variables it uses, which ones does it set For the last point, I'm aware I can do...

SetWindowsHookEx() , the hook is not maintained? (possibly)

Hi, I am trying to learn the Windows API. Currently I am having a lot of trouble trying to get hooks to work. I have some sample code I have been messing around with for a few days - it has a GUI written in C# or something, and a dll in C++. The dll has this function externalized: bool __declspec(dllexport) InstallHook(){ g_hHook ...

SendInput (C++) is not working.

The return value is 4 and I'm running Visual Studio in administrative mode so permissions should be ok. I don't see anything typed out though. Any help? I'm using Windows 7 x64. INPUT input[4]; input[0].type = INPUT_KEYBOARD; input[0].ki.wVk = 0; input[0].ki.wScan = 'a'; input[0].ki.dwFlags = KEYEVENTF_SCANCODE; input[0].ki.time = 0; i...