There are many pictures of hearts out there. I just wanted to draw a picture of a heart on my own from a math formula I found on the net. Seems there are many formulas to find. This is how it looks: ![Heart.PNG](/attachments/small/1/4c36fe9d031a39f8b3468f1c4f8a8f3d.PNG "align-left") Enjoy!

Member Avatar
+3 forum 0

What "Hello World" is to the console, the "Bouncing Ball" is to the Graphical User Interface. Nothing fancy, the ball is created via a call to the API function ellipse() and then bounced within the confines of the windows form. For the DEV C++ crowd: Let me know if you find these snippets somewhat helpful in your learning process in the comments section at the end.

Member Avatar
Member Avatar
+1 forum 22

After reading this excellent [code snippet](https://www.daniweb.com/software-development/csharp/code/492766/display-excel-data-in-a-datagridview) by djjeavons, and just trying to learn WPF, I decided: "Well, let's translate that to WPF!". It was a bit harder than I thought, but a great learning experience! Her's how my screen in action looks: ![WPFscreen.png](/attachments/small/1/ac05d33ccd8a190d0576fa063e54749f.png "align-left") Things that changed compared to the Forms version: --- OpenFileDialog works a bit different. --- WPF has no `DataGridView` but another beast called `DataGrid` --- Exiting an application has also changed. The communication with Excel still worked seamlessly. I managed to overcome the difficulties and learned alot in doing so. Hope you enjoy to find out …

Member Avatar
Member Avatar
+1 forum 4

Quite a while ago, I made [URL="http://www.daniweb.com/code/snippet217147.html"][B]this[/B][/URL] snippet. This code is basically the same, except that it adds animation. This method of blitting is very fast assuming you don't use a surface that's too large. On a 500 x 500 surface, I managed 350fps using only 0-1% of the cpu. This snippet may appear much slower because of the amount of CPU it's applying to each pixel, but the blitting itself is very fast. Also, don't forget that an average game will only redraw parts of the window that need redrawing, this redraws the whole surface every time. So, as …

Member Avatar
Member Avatar
+1 forum 13

Using the Python win32 extensions it is relatively simple to copy to and from the clipboard. Sorry. the Windows OS is a requirement.

Member Avatar
+0 forum 0

I had to map a network drive with specific credentials in my PHP script and it kept falling over because I'd already navigated to the drive in windows explorer. This snippet will unmap a network drive using COM regardless of whether or not there is a drive letter associated with it or not. I can call this bit of code before I attempt the mapping to make sure that the program doesn't fall over.

Member Avatar
+0 forum 0

In my job I tend to write a lot of Windows services. Due to this I've pared it down to bare essentials so that the code is as simple as possible, but still fully functional for the needs of each service. What this generally means is I *don't* use the service project in Visual Studio, instead favoring template code. After learning how services work, I found that the project was unnecessarily complex. Barring an installer, the basic project would have only two files: * **Program.cs**: Setup and startup * **Service.cs**: The actual service I usually separate the service from a …

Member Avatar
Member Avatar
+4 forum 2

Another quickie. This is a basic class for working with Windows path strings. It's based off of .NET's System.IO.Path class, but doesn't contain any API dependencies (and thus doesn't normalize the paths, it's all straight string handling). Methods that I've personally found to be useful are included. The class is specific to std::string so as to remain both simple and clean.

Member Avatar
Member Avatar
+0 forum 2

I borrowed this from C#, where you can easily send output, that normally goes to the ugly black console window, to a nice looking Windows MessageBox with an OK button to close after you read your results. You can accumulate your output in a string to send to one message box, or even use different message boxes. Experiment with it![code]// use a message box to display console output // compile as GUI // tested with Pelles C vegaseat 15jun2007 #include <windows.h> #include <string.h> #include <stdlib.h> int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { char output[1000]; char st[20]; …

Member Avatar
Member Avatar
+0 forum 2

This came up, maybe it is usefull to somebody. Later I plan to do a managing context interface to `with`statement for this.

Member Avatar
Member Avatar
+0 forum 2

This simple class encapsulates the exAnimatewindow api call. I got tired of adding all the jazz to every form I need to use as a pop up, or any borderless forms I used. (Windows 7 and vista don't animate windows with no border by default) This class could easily be expanded to offer all the animation directions and types But I included just the ones I use most often. I like a small footprint. No need for code you don't use. So just expand it if you need more functionality. here is the simple usage. Just throw this line in …

Member Avatar
+1 forum 0

This program uses the Python win32 extension module to get information on disk or flash drives for Windows machines. Specify the drive with its letter. If no drive letter is specified, the current drive is applied.

Member Avatar
Member Avatar
+4 forum 4

The End.