winapi

Why does WinAPI's GetSystemInfo tell that my quad-core machine has 8 cores?

I'm trying to find out how to get the number of CPU cores programmatically. This is the code I'm using: SYSTEM_INFO sysinfo; GetSystemInfo( &sysinfo ); std::cout << "CPU count: " << sysinfo.dwNumberOfProcessors << std::endl; This is running on Windows on the iMac i7 via Boot Camp. It would be nice to find out that Apple made a manufac...

How can shared folders using VMware Workstation 7 access hidden filenames?

For our build machines, we run VMware Workstation. We have source code checked out in a shared folder (shared from the host using VMware). In the builds we do svn operations like update etc. This worked fine until updating to Workstation 7. Now we get errors like this: svn: In directory 'E:\bitten\winxpbitten\bitten\j5-trunk\j5\Sites\C...

Crypto Next Generation API cross-platform compatibility issues

My problem is that I've written an application entirely using CNG on Windows 7, and now I have to port it backwards to Vista. Vista has CNG of course, but the SSL provider is an older version and is not always compatible - for example it won't import opaque keys exported from the Win7 version of the same provider. E.g. this code works ...

instant messaging program - works with 127.0.0.1, but not with other computers

I have followed a tutorial on http://www.codeproject.com/KB/IP/beginningtcp_cpp.aspxt which teaches how to use winsockets with c++, i finally managed to get my program to work, by testing wiht 127.0.0.1, i can open two process instances of my program and then make one listen on port (700) and then connect to it with the other program on...

Is there a command line utility that can listen for OS-wide keystrokes and tell me via stdout?

I'm developing an app and I'd like to trigger functions in my app via keystroke combos when it's not in focus. Because I'm developing my app in AIR, I do not have access to listen to global Keystrokes. However, I can receive STDOUT from an application. So, I'm looking for a utility that can give me this ability. I'm looking for both Win...

How to measure Windows API code coverage of app level benchmarks

My job involves system-level performance testing with third party tools that I do not have sources for. I'm also testing Windows, and can use debugging symbols but not Windows source code. I'd like a quantitative way to describe the areas of the host OS my tests cover. There are two big steps to this: identifying what DLLs and functio...

how to set system ip programatically

C++ how to programatically change system IP... and if the the account has Limited Rights how to use the password to perform the task ...

What does this line of C/C++ preprocessor mean?

This is Line 519 of WinNT.h (BUILD Version: 0091) #define DECLARE_HANDLE(name) struct name##__{int unused;}; typedef struct name##__ *name Why do we need a pointer to an struct with a single int member with a weird name called unused? And will we ever need to use a line of code like this one? HINSTANCE hInstance = new HINSTANCE__; ...

How to convert a stream of bytes to another encoding?

I'm trying to convert a stream of bytes with MultiByteToWideChar() WinAPI fucntion. Documentation says function fails with ERROR_NO_UNICODE_TRANSLATION on incomplete strings (no trailing byte in multibute encoded string). How do I prevent this error? The only way that comes to mind is not to convert the last multibyte character of input...

c++ win32 output a text

im using visual studio c++ 2008 i created project that contents the full window code. i don't know how to output text to window. i mean i have full functional window with menu bar and under the menu bar there is the body im trying to ouput the text in the body but how? ...

Problem using SysMonthCal32 window in Windows

I am using SysMonthCal32 windows in my application and I am seeing some strange problems while using it. The problem is regarding sending keydown event to calendar window. As per msdn documentation, if the window handles the message, it should return 0. The problem is whatever key i passes to the calendar window, it returns 0. This caus...

Some things missing from gnu gcc compiler headers? (commctrl.h)

I have been using the gcc compiler with code::blocks ide, and have noticed there are some things missing in the commctrl.h which are: PBS_MARQUEE and PBM_SETMARQUEE to set a progress bar to marquee animation style. LVS_EX_DOUBLEBUFFER for a double buffer on a list view... there are probably a lot more missing, but these are the ones i...

vc++ forms window

i have created a form using visual c++. all im trying to do is this when a button is clicked the form is gone and new window will be showen. i don't know if i should repaint the window or there is another solution? please help Rami ...

Edit Control Text Changed Message in C++\Win32

What is the Message that matches the TextChanged property in .NET for C++\Win32? ...

OpenGL don't show/draw on my C# pannel

Hi, I'm making a basic program in C# wich calls a C++ dll. I give the pannel's handle to the dll so OpenGL knows where to draw. [DllImport(@"../../../Debug/Model.DLL")] public static extern void startOpenGL(IntPtr hWindow); I mashall IntPtr hWindow to HWND hWindow. after I call draw from C# [DllImport(@"../../../Debug/M...

How do I set X coordinate of button without changing: y, width, height

I know I can use MoveWindow to move it but I only want to move the button on the x axis. Thanks. ...

SetupDiGetDeviceProperty

Dear friends.. Can anybody provide me the example of using SetupDiGetDeviceProperty () I have searched via google but i cant get it to work.. Thank you ...

arguments problem help

i have created a win32 window it work fine but im tryin to get command argument using lpcmdline. it works fine but when i try to compare it to string it to does work here is the comparing code TCHAR checking[]=_T("hello"); if(args==checking) // args equals lpcmdline like this LPTSTR args=lpcmdline { TCHAR greeting[]=_T("heys"); } e...

How to get logged-in user's full name in windows?

How to get logged-in user's full name (the one he/she entered as his/her real name) using windows API or something else? For example how to get "John Smith", not "john" (as it were his username). GetUserName(...) doesn't do the job because it returns the username, not the full name. ...

how to set printer quality to "best" mode?

if i set printer quality = DMRES_HIGH then also it printing in normal mode. ...