winapi

Why is my PE file invalid?

I already asked a similar question, "PE Header requirements", but I'm not really satisfied with it's answer. I am building an assembler/linker, in Java SE 1.6. I have read about 5 different documentations/specifications about the PE/COFF header and file format, but I'm stuck at a problem: My generated file is not valid, says Windows: "...

Tough question on WPF, Win32, MFC

Let's suppose you're an IT student with a basic knowledge of C++ and C#. Let's suppose that you want to design apps that: need to deliver some performance like archivers, cryptographic algorithms, codecs make use of some system calls have a gui and you want to learn an Api that will enable you to write apps like those described earli...

deleting HBITMAP causes an access violation at runtime.

Hi, I have the following code to take a screenshot of a window, and get the colour of a specific pixel in it: void ProcessScreenshot(HWND hwnd){ HDC WinDC; HDC CopyDC; HBITMAP hBitmap; RECT rt; GetClientRect (hwnd, &rt); WinDC = GetDC (hwnd); CopyDC = CreateCompatibleDC (WinDC); //Create a bitmap compatible with the DC hBitmap = Cre...

Creating application forms without border, but with shadow (in Windows Vista&Windows 7)

How to do that in WinForms? ...

windows shell scripting through java

i am designing a desktop application like nero for removable media storage that also includes features of copyfast. i want to add an option of my own choice in the windows explorer right click menu. how can i do that? am i proceeding in the right direction? ...

Win32 textBox in treeview

I want to add textbox in treeview as child of one of the parent node. Is it possible> If yes how to achieve this? ...

Global WH_CBT hook DLL is loaded into some processes only

The main program calls the function SetHook in the wi.dll to install global WH_CBT hook. bool WI_API SetHook() { if (!g_hHook) { g_hHook = SetWindowsHookEx(WH_CBT, (HOOKPROC) CBTProc, g_hInstDll, 0); } return g_hHook != NULL; } I presume after installing global hook, wi.dll should be loaded into each process' ...

Which technology(MFC/Win32) is more sutaible for directx application?

Hi i am developing game level editor.Currently I am using win32 with directX.But with win32 I cant achieve fully object oriented implementation.So I am thinking to develop it in MFC. Will it be better option than win32? Which technology(MFC/Win32) is widely used in industry? Also which technology is most suitable for my project? ...

Printer log viewer

Can some one guide me on how to get the log for a network printer from server? mainly user,ip,computer name,document name, page count Thank you ...

Resetting a PChar variable

Hi, I don't know much about delphi win 32 programming, but I hope someone can answer my question. I get duplicate l_sGetUniqueIdBuffer saved into the database which I want to avoid. The l_sGetUniqueIdBuffer is actually different ( the value of l_sAuthorisationContent is xml, and I can see a different value generated by the call to g...

What is used instead of SendMessage and PostMessage in Java to handle inter-thread communications?

I'm from a WinAPI / C++ background, and I'm curious as to what the Java world uses in place of a threaded message loop in a worker thread to handle communications and interactions between threads. The idea is to use a message pump in both the worker thread, and the main thread, and have them posting messages back and forth. This solution...

How to properly recreate BITMAP, that was previously shared by CreateFileMapping()?

Dear friends, I need your help. I need to send .bmp file to another process (dialog box) and display it there, using MMF(Memory Mapped File) But the problem is that image displays in reversed colors and upside down. Here's source code: In first application I open picture from HDD and link it to the named MMF "Gigabyte_picture" HANDLE...

How to GetGuiResources for all system processes?

Hello, I need to measure all used GDI objects in a Windows xp system. I found a GetGuiResources(__in HANDLE hProcess, __in DWORD uiFlags) method (with the GR_GDIOBJECTS flag). I call it for the process which I get from the method GetCurrentProcess() defined in WinBase.h. I don't know how to call it for other system processes, which ...

Is there a size limit on WritePrivateProfileStruct?

I'm trying to write an INI file using the WritePrivateProfileString and WritePrivateProfileStruct functions. I found that when the byte count is relatively low, WritePrivateProfileStruct and GetPrivateProfileStruct work fine, but with a higher byte count (62554 bytes in my case), the Write function seems to work but the Get function do...

How to obtain FireFox newly created window handler?

I have starter new System.Diagnostics.Process and it launchs FireFox. How can I obtain the Handler of that window? Any ideas - C#, winAPI functions... anything (just not ASM ;) ) ...

What does the '@' mean when prefixed to Windows font face name?

With EnumFontFamiliesEx, I get two instances of some fonts, the second of which has '@' prefixed to the face name in the LOGFONT. For example, I get "MS PMincho" and "@MS PMincho". Yet for other fonts, I just get a single instance, like "Arial". What does the at-sign mean in this context? ...

Exception_Record in python2.5 problem

I'm using Python2.5 & the following code produce 2 errors. Can any body help me? class EXCEPTION_RECORD(Structure): _fields_ = [ ("ExceptionCode", DWORD), ("ExceptionFlags", DWORD), ("ExceptionRecord", POINTER(EXCEPTION_RECORD)), ("ExceptionAddress", LPVOID), ("NumberParameters", DWORD), ...

How does one obtain the Windows installation date, without using WMI?

Not much to say about this question... ...

Login to a remote machine & accessing network resources

Hi, I want to access a file on remote machine(win2k3, 10.10.20.30), but i couldn't understand how to login to that machine in my program. is there any simple win api that takes network path, credentials and returns the handle? i just want to access \10.10.20.30\c$\test.txt, WNetAddConnection2, WNetAddConnection3 are little confusing. A...

Making an owner-draw button transparent against its arbitrary background in WINCE

Hi I am trying to place an owner-draw button transparently onto a background. I have no trouble doing this when the background is a solid colour but if the background is an image I cannot seem to get the correct HDC (handle to device context) to Bitblt() the area that button covers. The HDC that is passed as part of the DRAWITEMSTRUCT...