Click here to Skip to main content
15,881,172 members
Everything / Desktop Programming / Win32

Win32

Win32

Great Reads

by Szymon Roslowski
Just another approach to understanding communication between HID devices and C#.
by Jeffrey Walton
Import and export Cryptographic Keys in PKCS#8 and X.509 formats, using Crypto++, C#, and Java.
by Martin Mitáš
How to support scrolling within your controls.
by Hans Dietrich
XColorSpectrumCtrl displays a color spectrum that allows user selection, and provides APIs for color based on RGB and HSL color models.

Latest Articles

by Michael Chourdakis
An introduction to machine learning with working C++ code that trains a linear regression model.
by Ștefan-Mihai MOGA
Task Manager shows you the programs, processes, and services that are currently running on your computer. You can use Task Manager to monitor your computer’s performance or to close a program that is not responding.
by Ștefan-Mihai MOGA
This article is about the IntelliFile application which is a free alternative Windows version to Total Commander and uses many components that have been published on CodeProject.
by Michael Chourdakis
DirectX hardware screen capture and encoding with audio mixing capabilities. H264/H265/VP80/VP90/FLAC/MP3. HDR supported.

All Articles

Sort by Updated

Win32 

20 Aug 2009 by "Fish" (David B. Trout)
A command-line tool to run multiple programs in parallel (i.e. concurrently, as a group).
19 Oct 2010 by "Fish" (David B. Trout)
Simple parsing of VS_VERSIONINFO version information strings displayed in an XP-style file-properties "Version" tab
3 Jan 2010 by #realJSOP
I think your problem is that you expect the LittleDrummerBoy object to be instantiated with the appropriate parameters, when in fact, it won't be. The PsychoBicthFromTheWeb class appears to be a little too random, and the GAK! will throw an exception. How you handle the GuitarMan exception...
23 May 2010 by #realJSOP
Google the phrase "WMI C++". I'm sure you'll come up with a bunch of hits.
16 Sep 2010 by #realJSOP
You have to paint the control yourself. And why on earth would you want to NOT use the frameworks available to you?
7 Dec 2010 by #realJSOP
Macros are compile-time features, not runtime features.One way to accomplish this would be to include one or more DLLs in your project that turn one various features, and then base those features' availablity on the presence or absence of the DLLs. Of course, there are many other ways,...
8 Dec 2010 by #realJSOP
The Win32 API isn't meant to "wrap" your code. Your code is supposed to wrap the API. By creating an assembly in .Net, and assuming you've made your classes public, other programmers can make use of YOUR "api".
17 Dec 2010 by #realJSOP
That error usually indicates a screwed up pointer somewhere in your code. Sorry I can't be more specific, but it's been a while since I did any unmanaged C++ stuff.
21 Dec 2010 by #realJSOP
I found this with google (you know - that free search engine at www.google.com):http://support.microsoft.com/kb/241849[^]
10 Jan 2011 by #realJSOP
An abstract class cannot be instantiated. You MUST derive a new class from it, and implement all of the pure virtual functions in it, and then use the new class instead.This is basic C++ stuff...
24 Jan 2011 by #realJSOP
It's called the System Managment Console. Right click My Computer, select "Manage" from the context menu, and when the form comes up, look atr the bottom, and there's an entry in the tree labeled "Windows Services". Click that, and you'll see all of the services.
9 Feb 2011 by #realJSOP
It's part of the file system, so I would look at the System.IO namespace for that kind of stuff. The FileInfo.GetAccessControl method looks interesting.
17 Mar 2011 by #realJSOP
They both do the same thing. strcpy_s is standard C, and the other is MFC a native Windows API. Google really does work. Try this link:http://msdn.microsoft.com/en-us/library/ms646979(v=VS.85).aspx[^]
7 Apr 2011 by #realJSOP
Your operating system support should be restricted to XP, Vista, Windows 7, Server 2003-2008. Everything older than those is irrelevant and so obsolete that they make Warren Buffet look like a spring chicken.Further, unless you have a tangible requirement to create 64-bit software, don't...
17 Jul 2011 by #realJSOP
I found this when I googled this - "Catch CTRL_SHUTDOWN_EVENT in Win7"[^]
26 Aug 2011 by #realJSOP
You can't avoid using enumChildWindow. The tab pages are (probably) child windows of the tab control.
17 Jun 2018 by #realJSOP
Google is your friend: Google - c# add watermark to printed page[^]
8 Mar 2009 by Đonny
This article introduces and describes a framework that allows the creation of managed plug-ins for the Total Commander file manager.
8 Oct 2012 by (unkownOfMe)
Hello, i try to connect access using MFC,here is the sample codeCString str;str=_T("Provider=Microsoft.Jet.OLEDB.4.0;""Data Source=C:\\Users\\User\\Documents\\DataBase.mdb;");there is an error,error C2308: concatenating mismatched strings1> Concatenating wide...
17 Sep 2023 by .dan.g.
A hierarchical task manager with native XML support for custom reporting
29 Mar 2011 by 01.mandar
himy problem is about dereferencing the void* to string so i can display value so far i have created a dll which exports somefun()MY.dll in C std callingvoid* somefun(){ return &eax;}this function is then loaded in Javascript via jcstypes for XUL...
30 Mar 2011 by 01.mandar
this code works properly on my machine but when i copy it to another machine with all its prerequisite it stops at line 5: var lib = ctypes.open("C:\\myapp\\dl1.dll");function initport() {Components.utils.import("resource://gre/modules/ctypes.jsm"); var lib =...
21 Apr 2011 by 01.mandar
is it possible to convert to LPCWSTR using mbstowcs?
11 May 2011 by 01.mandar
when i write AT Commands in dat array for sending it to GSM Deviceint TransxPortGSM() Functionunsigned char dat[3]={'A','T'};//tried char,int..DWORD dwNumBytesWritten=sizeof(dat); check=WriteFile( hPort, // Port is getting correct &dat, ...
17 Oct 2011 by 01.mandar
How can we parse RegOpenKeyEx(HKEY_LOCAL_MACHINE,L"SYSTEM\\CurrentControlSet\\Enum\\BTHENUM\\{00001101-0000-1000-8000-00805f9b34fb}_LOCALMFG&000f\\9&3408FE52&0&646E6C00E02E_C00000000\\Device Parameters", 0, KEY_QUERY_VALUE, &hKey) )so that we can use it for each GUID (traversing...
19 Oct 2011 by 01.mandar
i have written Bluetooth code in win32 which detected bluetooth devices in range andafter installing bluetooth device on my PC it creates more than one COM portto get serial port i search in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSetbut some time the newly installed bluetooth do not...
20 Oct 2011 by 01.mandar
i have 2 Bluetooth1. PC dongle and 2. Mobile Bluetooth Device of same make in normal installation we goto Control Panel and do add device ,this device directly gets added in the system and pair with each other without using any key.i want to automate this by getting event from the OS...
11 Nov 2011 by 01.mandar
i my serial port reads only 30 bytes ?i cant find issue in dcb though. DCB dcb_ob; COMMTIMEOUTS ct_ob; dcb_ob.DCBlength =32;//sizeof(DCB); dcb_ob.BaudRate = CBR_115200; // Current baud dcb_ob.fBinary = TRUE; // Binary mode; no EOF check dcb_ob.fParity =...
12 Nov 2011 by 01.mandar
i have created dll in vc++init_set(char *) takes char *extern "C" MYDLL_API int init_set(char*);extern "C" MYDLL_API int init_valid();in c# i want to pass an string to init_set(). [DllImport("MYDLL.dll")] public static extern int init_set(char[] s); ...
14 Nov 2011 by 01.mandar
Quote: it is necessary to do GetCommState() before SetCommState() reference code: http://msdn.microsoft.com/en-us/library/windows/desktop/aa363201(v=vs.85).aspx[^]
24 Apr 2012 by 01.mandar
Hi friendsi have created an opengl application(moving color triangle) and runs perfectly(using glut).i wanted to pack the opengl application code into dll.another NEW win32 application will load the dll and create a new blank window, now i want to run the code from the dll into the...
25 Apr 2012 by 01.mandar
Hi FriendsI have created a MDI form in that i have 2 forms (treeview form and information form)in 2nd (information form) i have added 2 buttons next and previousminimize, maximize works on all of client form correctly(before any click on 2nd form)Problem:when i click button...
19 May 2012 by 01.mandar
i have win32api mdi form with 4 child window.one of the child window runs opengl code but really slow.i want to make fullscreen when f key is pressed.what is better solution to make window fullscreen(no taskbar & titlebar) without delay in opengl execution.
21 Jun 2012 by 01.mandar
i have done a opengl application in win32 only using platform library.it was performing very slow so i decided to do the same opengl project using glut libraryopengl code workes fine in glut but not in win32.i thought it would be because of wm-paint so i did it with timer but no effect...
26 Jul 2013 by 2006 Flauzer
I'm developing a C# assembly which is to be called via COM from an old vb6 (ie, "native" win32, not .net) application. I've installed VS2010 Premium in a W7 x64 and simply my goal is to use Visual Studio to debug the C# code...Other hint: the C# assembly is compiled in "x86 mode" (.NET4)...
29 Jul 2013 by 2006 Flauzer
From menu Debug->"Attach to.." option, please point the correct process ie, dllhost.exe COM Surrogate. and not win32 client....
4 Jul 2008 by 2b|!2b==?
A command-line program that backs up folders and files specified in a text file to CD-W
14 Jan 2020 by _Asif_
It's easy and a good example can be found here Visual C++ Enable Console - Stack Overflow[^] Do a little search and you will find plenty of examples more.
5 Aug 2013 by _Damian S_
Save your query directly in Access, then simply return the results of your query through ADO, rather than letting ADO try to do the work for you.
5 Aug 2013 by _Damian S_
Couple of options... either create a query to group by County and TGTE and count the ID field, then run a crosstab query over that...or...Create a subquery for each of the two types of TGTE, group by county and where clause on the TGTE, then have a main query to return the County,...
16 Sep 2015 by _Plutonix
Framework for NET based Shell Context Menus using VB, C#
22 Jul 2016 by Aaditya Vishwakarma
I've been learning and practising programming with C/C++ for two years and now I'm pretty good at this. But now I want to learn windows system programming with win32 apis, I've tried some books like Addison_Wesley_Windows_System_Programming and a few others but they didn't work for me as I felt...
17 Jun 2015 by Aashish Aswal
I have a 32 bit MFC Print Application that uses StartDoc API for printing. In 32 bit OS, i didn't configure any Default Print Driver, then on File Print I selected Microsoft XPS Document Writer. A "Save as File" Dialog pops up which runs in the same Process as that of Application. Now I have...
1 Feb 2013 by aaverian
A very simple console progress bar.
17 Jan 2009 by Abdallah Gomah
How to extract icons from EXE/DLL, split/merge icons, and get icons associated with files.
28 Jul 2019 by Abduu Atef
I have a problem with accessing the process This is the code Dim p As Process = Process.GetProcessesByName("Wolfteam.bin")(0) For Each moz As System.Diagnostics.ProcessModule In p.Modules If moz.FileName.IndexOf("obj") -1 Then Label1.Text =...
25 Mar 2011 by Abhi Lahare
Hope this helps, but not sure how much.http://msdn.microsoft.com/en-us/library/aa366773%28v=vs.85%29.aspx[^]
26 Jul 2011 by Abhi Lahare
How about displaying alert box like Communicator, The only things which worries me is that if the frequency is too high. The user will be constantly losing focus because of changing values in the alert window.
17 Feb 2010 by Abhinav S
Something here[^]. Not sure if this is useful to you though.
27 Sep 2011 by abhinav_soni
The ATL COM DLL that captures requests from individual Webbrowser Control
16 Feb 2012 by Abhineet Ayan Verma
Hi All, Why my QueueUserWorkItem is not at all working. My code is here:typedef struct{ PCHAR URL[MAX_URL] ; PCHAR DestinationPath ;}MAINDATA, *PMAINDATA ;int main(int argc, char * argv[]){ PMAINDATA pData ; BOOL bQuwi ; DWORD dwIndex ; PCHAR pURL ; ...
18 Feb 2012 by Abhineet Ayan Verma
How to set event in case of calling CreateSemaphore ? I mean what I should use to avoid Main from exiting before my threads if I am implying CreateSemaphore in the Main itself??? I am using QueueUserWorkItem with Semaphore. Anybody please.
28 Jul 2008 by Abhishek Sur
The article will help you to use Isolated Storage Classes
7 Sep 2009 by Abhishek Sur
Some of both Documented and Undocumented Keywords that we dont use often like Check, StackAlloc, Fixed,default,@variables,Nullables, __arglist,__reftype etc are explained with simple examples
14 Sep 2009 by Abhishek Sur
Make your class library COM visible using few simple steps
17 Jan 2010 by Abhishek Sur
Implement services that start/stop automatically to some events like Device attached, Network Availability, Firewall port modified, Domain join, Group Policy change etc
28 May 2012 by Adam Roderick J
A brief and basic explanation about the PE data structures, with a sample
6 Feb 2014 by Adamanteus
Intercepting SEH exceptions in C++ program
13 Sep 2010 by Adhish Pendharkar
Launch Application Forms in MultiScreen
26 Feb 2009 by Adrian Dorache
Scripting the clipboard content in Windows Script Host.
27 Sep 2010 by Aescleal
I tend to use boost::interprocess::named_mutex for the same thing. The equivalent code is something like:using boost::interprocess;const char *application_name = "Application Name";int main()try{ struct named_mutex_killer { ~named_mutex_killer() {...
21 Oct 2010 by Aescleal
printf is so 1980s. If you don't want to dig out your shoulder pads and big hair why not go for a more modern C++ approach?Instead of a function try a stream buffer:class message_box_stream_buf : public std::basic_streambuf{ public: message_box_stream_buf( const...
28 Oct 2010 by Aescleal
What happens if you put a full path in for the call to fopen? Something like:FILE *file_ptr = fopen( "c:\\test.txt", "a+" );making sure the path is somewhere that can be written to by just about anything. If that works then you know the problem is the current working directory of...
25 May 2012 by Aescleal
Provided the IDs are consistent between the source file and the resource file you can call them whatever you like.You might find that the The reason the IDE has generated some weird looking IDs is that MFC defines ID_FILE_NEW and ID_FILE_OPEN and it wanted to make sure that there wasn't...
6 Jun 2012 by Aescleal
And adding to Albert's and Jack's answers there's a quick answer as to when you need to use RPC:Only when whatever code you're trying to call makes you use it.Otherwise, forget it, at least at first. RPC comes with loads of baggage. You'd spend most of your time playing with interface...
7 Nov 2013 by Aescleal
I'm surprised that making the combo box either of the owner draws styles is messing up the theme. USER should still be drawing most of the control and your code is just responsible for drawing the items. While I haven't used an owner draw CB in yonks I've got an owner draw listbox that still...
2 May 2013 by aesongi
I tried to start a process in service session ( session 0 : window 2008 server (session 0 isolation)) with user account. then I use LogonUser and createProcessAsUser api.....but, user account('frank') //session id :0 //process name: notepad.exe when interactive service and desktop is...
11 Jul 2017 by Afzaal Ahmad Zeeshan
Since you are using the content and material provided under an Article at CodeProject, this post is likely off-topic and it is encouraged that you ask this question on that Article — there is a forum provided under the post. You should ask it there, for several reasons. First, the author knows...
8 Feb 2016 by aglom08
@MuhammadUSman1You can use autoIT for this type of handling because autoIT is good and you can handle easily.Just you have to run exe file in selenium.
15 Feb 2016 by Ahmed Amer Jaf
Fast n Easy Way to parse Json data
17 Jan 2016 by Ahmed Amer Jaf
Downloading files from the Internet with one line without Freezing Form
11 Jun 2013 by Ahmed Bensaid
Take a look at : In C#, how to make listview background Transparent
6 Mar 2013 by Ahmed Elkafrawy
An easy way to simulate keyboard press & release keys to another application
28 Apr 2017 by Ahmed Elkafrawy
Implementation of an easy, fast, and optimized (CByte, CShort, CInt) with bits access using bit field and union
23 Oct 2010 by Ahmed_Said
Creating a custom Jumplist with custom events and examining all of its features in Windows Forms 3.5
14 May 2012 by ahsanriaz1K
Hi,I have a VS2005 solution having one project of C++ console application and more than one library projects.When i run the c++ console application , command prompt appears but vanishes immediately. I have a lot of break points in this application. Some time before it was stopping at console...
14 May 2012 by ahsanriaz1K
I recompile the whole solution. I think a rebuild was required.Problem solved.
13 May 2008 by aisha.ansari
post office protocol to retrieve mails
10 Apr 2016 by AIT SALEM BOUSSAD
This first part of the article presents how to inject a DLL inside lsass process by using Windows service
12 Jan 2008 by ajalilqarshi
This article covers calling Java functions from C using JNI. It also covers passing/returning simple parameters, arrays, and structure arrays in Java functions.
6 Apr 2010 by Ajay Vijayvargiya
Learn from this guide how and when - as well as when not - to use multithreading.
12 Apr 2010 by Ajay Vijayvargiya
More of practical situations to use multithreading!
11 Nov 2010 by Ajay Vijayvargiya
Learn about parallel algorithms, parallel containers, tasks, task groups, agents library, task scheduler etc in VC10
20 Oct 2010 by Ajay Vijayvargiya
Need to Format/sprintf a string before displaying a messagebox? Here is solution!
10 Jan 2011 by Ajay Vijayvargiya
19 Apr 2012 by Ajay Vijayvargiya
Many Windows C++ programmers get confused over what bizarre data type identifiers like TCHAR and LPCTSTR are. Here, in brief, I will try to clear out the fog.
24 Jan 2011 by Ajay Vijayvargiya
Learn how you can write your own Windows debugger.
18 Sep 2011 by Ajesh Novell
Hi,I am using NetWkstaGetInfo() , TranslateName() & NetGetJoinInformation() API to query information for AD users like get the computer name for the remote server, convert upnames to other formats etc. These API's works fine when I am connected to network but when my network is down, these...
21 Sep 2011 by Ajesh Novell
Hi,I am calling LsaLookupNames() API for a domain user and it is failing with error code 1789 i.e untrusted connection. Before calling LsaLookupNames() I was succesfully calling LsaOpenPolicy() with POLICY_ALL_ACCESS flag. Can anyone suggest me a method to suppress this error or how to make...
28 Dec 2014 by Akos Mattiassich
Find a window on the desktop, spy its properties and manipulate it.
17 Apr 2011 by Akos Szabo
Hi,I have an issue. I have to detect a slow TTL sign and measure the time between to signs. I do not want to build a circuit for this. My idea would be to connect the source of the sign to a COM port (USB/RS232). Change on any of the control line (DTR, RTS) causes an interrupt. Hooking the...
18 Mar 2014 by ala deli
can anyone explain to me the realation between these classes:-Win32_DiskDrive-Win32_LogicalDisk-Win32_Volume-Win32_DiskPartition
2 Nov 2019 by Alaa Ben Fatma
Use your skills as a designer to create gorgeous control
7 Apr 2014 by Alain DOS REIS
A first approach to mixing .NET and native code, using the C++/CLI gateway.
18 Feb 2009 by Alain Rist
OOo::DocWindow and WTL::COOoCtrl classes to work on any Microsoft-Office document, and Open Office SDK integration in Visual Studio/VCExpress 2005/2008
12 Apr 2010 by Alain Rist
Including a Ribbon UI Implementation Guide with examples and a dual UI enabled legacy application
19 Jul 2010 by Alain Rist
I've written my own serial handling functions, they work great,I've tested them.Hmm, they don't seem to work that well :) You need a listener thread filling some buffer with the incoming characters and signalling the main thread when a full sentence is ready.The main thread should...