<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vdiscussion &#187; Visual Programming</title>
	<atom:link href="http://vdiscussion.com/category/theory-subjects/visual-programming-theory-subjects/feed/" rel="self" type="application/rss+xml" />
	<link>http://vdiscussion.com</link>
	<description>Vinoth Kumar&#039;s Discussion</description>
	<lastBuildDate>Wed, 09 Dec 2009 15:34:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>What is Nonpreemptive Multitasking : Visual Programming</title>
		<link>http://vdiscussion.com/what-is-nonpreemptive-multitasking-visual-programming/</link>
		<comments>http://vdiscussion.com/what-is-nonpreemptive-multitasking-visual-programming/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 15:38:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[Dynamic Data Exchange]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Modes of Multitasking]]></category>
		<category><![CDATA[Nonpreemptive Multitasking]]></category>
		<category><![CDATA[Object Linking and Embedding]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=67</guid>
		<description><![CDATA[When Microsoft introduced Windows 1.0 in 1985, it was the most sophisticated solution yet devised to go beyond the limitations of DOS. Back then, Windows ran in real mode, but even so, it was able to move memory blocks around in physical memory—a prerequisite for multitasking—in a way that was not quite transparent to applications [...]]]></description>
			<content:encoded><![CDATA[<p>When Microsoft introduced Windows 1.0 in 1985, it was the most sophisticated  solution yet devised to go beyond the limitations of DOS. Back then, Windows ran  in real mode, but even so, it was able to move memory blocks around in physical  memory—a prerequisite for multitasking—in a way that was not quite transparent  to applications but almost tolerable.</p>
<p>Multitasking makes a lot more sense in a graphical windowing environment than  it does in a command-line single-user operating system. For example, in  classical command-line UNIX, it is possible to execute programs off the command  line so that they run in the background. However, any display output from the  program must be redirected to a file or the output will get mixed up with  whatever else the user is doing.</p>
<p>A windowing environment allows multiple programs to run together on the same  screen. Switching back and forth becomes trivial, and it is also possible to  quickly move data from one program to another; for example, to imbed a picture  created in a drawing program into a text file maintained by a word processing  program. Data transfer has been supported in various ways under Windows, first  with the clipboard, later through Dynamic Data Exchange (DDE), and now through  Object Linking and Embedding (OLE).</p>
<p>Yet the multitasking implemented in the early versions of Windows was not the  traditional preemptive time-slicing found in multiuser operating systems. Those  operating systems use a system clock to periodically interrupt one task and  restart another. The 16-bit versions of Windows supported something called  &#8220;nonpreemptive multitasking.&#8221; This type of multitasking is made possible because  of the message-based architecture of Windows. In the general case, a Windows  program sits dormant in memory until it receives a message. These messages are  often the direct or indirect result of user input through the keyboard or mouse.  After processing the message, the program returns control back to Windows.</p>
<p>The 16-bit versions of Windows did not arbitrarily switch control from one  Windows program to another based on a timer tick. Instead, any task switching  took place when a program had finished processing a message and had returned  control to Windows. This nonpreemptive multitasking is also called &#8220;cooperative  multitasking&#8221; because it requires some cooperation on the part of applications.  One Windows program could tie up the whole system if it took a long time  processing a message.</p>
<p>Although nonpreemptive multitasking was the general rule in 16-bit Windows,  some forms of preemptive multitasking were also present. Windows used preemptive  multitasking for running DOS programs and also allowed dynamic-link libraries to  receive hardware timer interrupts for multimedia purposes.</p>
<p>The 16-bit Windows included several features to help programmers solve—or at  least cope with—the limitations of nonpreemptive multitasking. The most  notorious is, of course, the hourglass mouse cursor. This is not a solution, of  course, but just a way of letting the user know that a program is busy working  on a lengthy job and the system will be otherwise unusable for a little awhile.  Another partial solution is the Windows timer, which allows a program to receive  a message and do some work at periodic intervals. The timer is often used for  clock applications and animation.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/what-is-nonpreemptive-multitasking-visual-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Elements of MDI in Visual Programming</title>
		<link>http://vdiscussion.com/the-elements-of-mdi-in-visual-programming/</link>
		<comments>http://vdiscussion.com/the-elements-of-mdi-in-visual-programming/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 15:33:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[Elements of MDI]]></category>
		<category><![CDATA[MDI]]></category>
		<category><![CDATA[MDI application]]></category>
		<category><![CDATA[MDI document window]]></category>
		<category><![CDATA[MDI in Visual Programming]]></category>
		<category><![CDATA[WS_CHILD]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=64</guid>
		<description><![CDATA[The main application window of an MDI program is conventional: it has a title bar, a menu, a sizing border, a system menu icon, and minimize/maximize/close buttons. The client area, however, is often called a &#8220;workspace&#8221; and is not directly used to display program output. This workspace contains zero or more child windows, each of [...]]]></description>
			<content:encoded><![CDATA[<p>The main application window of an <strong>MDI</strong> program is conventional: it has a title  bar, a menu, a sizing border, a system menu icon, and minimize/maximize/close  buttons. The client area, however, is often called a &#8220;workspace&#8221; and is not  directly used to display program output. This workspace contains zero or more  child windows, each of which displays a document.</p>
<p>These child windows look much like normal application windows and much like  the main application window of an MDI program. They too have a title bar, a  sizing border, a system menu icon, minimize/maximize/close buttons, and possibly  scroll bars. None of the document windows has a menu, however. The menu on the  main application window applies to the document windows.</p>
<p>At any one time, only one document window is active (indicated by a  highlighted title bar), and it appears in front of all the other document  windows. All the document child windows are clipped to the workspace area and  never appear outside the application window.</p>
<p>At first, MDI seems a fairly straightforward job for the Windows programmer.  All you need to do is create a <strong>WS_CHILD</strong> window for each document, making the  program&#8217;s main application window the parent of the document window. But with a  little exploration of existing MDI applications, you&#8217;ll find some complications  that require difficult code.</p>
<ul>
<li>An MDI document window can be minimized. A short title bar with an icon  appears at the bottom of the workspace. Generally, an MDI application will use  different icons for the main application window and each type of document  window.</li>
<li>An MDI document window can be maximized. In this case, the title bar of the  document window (normally used to show the filename of the document in the  window) disappears and the filename appears appended to the application name in  the application window&#8217;s title bar. The system menu icon of the document window  becomes the first item in the top-level menu of the application window. The  button to close the document window becomes the last item in the top-level menu  and appears to the far right.</li>
<li>The system keyboard accelerator to close a document window is the same as  that to close the main window, except that the Ctrl key is used rather than Alt.  That is, Alt-F4 closes the application window, while Ctrl-F4 closes the document  window. In addition, Ctrl-F6 switches among the child document windows within  the active MDI application. Alt-Spacebar invokes the system menu of the main  window, as usual. Alt&#8211; (minus) invokes the system menu of the active child  document window.</li>
<li>When using the cursor keys to move among items on the menu, control normally  passes from the system menu to the first item on the menu bar. In an MDI  application, control passes from the application system menu to the active  document system menu to the first item on the menu bar.</li>
<li>If the application is capable of supporting several types of child windows  (for example, the worksheet and chart documents in Microsoft Excel), the menu  should reflect the operations associated with that type of document. This  requires that the program change the menu when a different document window  becomes active. In addition, when no document window exists, the menu should be  stripped down to only those operations involved in opening or creating a new  document.</li>
<li>The top-level menu bar has an item called Window. By convention, this is the  last item on the top-level menu bar except for Help. The Window submenu  generally has options to arrange the document windows within the workspace.  Document windows can be &#8220;cascaded&#8221; from the upper left or &#8220;tiled&#8221; so that each  document window is fully visible. This submenu also has a list of all the  document windows. Selecting one moves that document window to the foreground.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/the-elements-of-mdi-in-visual-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Caret Functions in Visual Programming</title>
		<link>http://vdiscussion.com/the-caret-functions-in-visual-programming/</link>
		<comments>http://vdiscussion.com/the-caret-functions-in-visual-programming/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 14:51:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[Caret Functions]]></category>
		<category><![CDATA[CreateCaret]]></category>
		<category><![CDATA[DestroyCaret]]></category>
		<category><![CDATA[GetCaretBlinkTime]]></category>
		<category><![CDATA[GetCaretPos]]></category>
		<category><![CDATA[HideCaret]]></category>
		<category><![CDATA[SetCaretBlinkTime]]></category>
		<category><![CDATA[SetCaretPos]]></category>
		<category><![CDATA[ShowCaret]]></category>
		<category><![CDATA[WM_CREATE]]></category>
		<category><![CDATA[WM_DESTROY]]></category>
		<category><![CDATA[WM_KILLFOCUS]]></category>
		<category><![CDATA[WM_SETFOCUS]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=62</guid>
		<description><![CDATA[The Caret (Not the Cursor) When you type text into a program, generally a little underline, vertical bar, or box shows you where the next character you type will appear on the screen. You may know this as a &#8220;cursor,&#8221; but you&#8217;ll have to get out of that habit when programming for Windows. In Windows, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The Caret (Not the Cursor)</strong></p>
<p>When you type text into a program, generally a little underline, vertical  bar, or box shows you where the next character you type will appear on the  screen. You may know this as a &#8220;cursor,&#8221; but you&#8217;ll have to get out of that  habit when programming for Windows. In Windows, it&#8217;s called the &#8220;caret.&#8221; The  word &#8220;cursor&#8221; is reserved for the little bitmap image that represents the mouse  position.</p>
<p>There are five essential <strong>caret functions</strong>:</p>
<ul>
<li><em>CreateCaret</em> Creates a caret associated with a window.</li>
<li><em>SetCaretPos</em> Sets the position of the caret within the window.</li>
<li><em>ShowCaret</em> Shows the caret.</li>
<li><em>HideCaret</em> Hides the caret.</li>
<li><em>DestroyCaret</em> Destroys the caret.</li>
</ul>
<p>There are also functions to get the current caret position  (<em>GetCaretPos</em>) and to get and set the caret blink time  (<em>GetCaretBlinkTime</em> and <em>SetCaretBlinkTime</em>).</p>
<p>In Windows, the caret is customarily a horizontal line or box that is the  size of a character, or a vertical line that is the height of a character. The  vertical line caret is recommended when you use a proportional font such as the  Windows default system font. Because the characters in a proportional font are  not of a fixed size, the horizontal line or box can&#8217;t be set to the size of a  character.</p>
<p>If you need a caret in your program, you should not simply create it during  the WM_CREATE message of your window procedure and destroy it during the  WM_DESTROY message. The reason this is not advised is that a message queue can  support only one caret. Thus, if your program has more than one window, the  windows must effectively share the same caret.</p>
<p>This is not as restrictive as it sounds. When you think about it, the display  of a caret in a window makes sense only when the window has the input focus.  Indeed, the existence of a blinking caret is one of the visual cues that allows  a user to recognize that he or she may type text into a program. Since only one  window has the input focus at any time, it doesn&#8217;t make sense for multiple  windows to have carets blinking all at the same time.</p>
<p>A program can determine if it has the input focus by processing the  WM_SETFOCUS and WM_KILLFOCUS messages. As the names imply, a window procedure  receives a WM_SETFOCUS message when it receives the input focus and a  WM_KILLFOCUS message when it loses the input focus. These messages occur in  pairs: A window procedure will always receive a WM_SETFOCUS message before it  receives a WM_KILLFOCUS message, and it always receives an equal number of  WM_SETFOCUS and WM_KILLFOCUS messages over the course of the window&#8217;s lifetime.</p>
<p>The main rule for using the caret is simple: a window procedure calls  <em>CreateCaret</em> during the WM_SETFOCUS message and <em>DestroyWindow</em> during the WM_KILLFOCUS message.</p>
<p>There are a few other rules: The caret is created hidden. After calling  <em>CreateCaret</em>, the window procedure must call <em>ShowCaret</em> for the  caret to be visible. In addition, the window procedure must hide the caret by  calling <em>HideCaret</em> whenever it draws something on its window during a  message other than WM_PAINT. After it finishes drawing on the window, the  program calls <em>ShowCaret</em> to display the caret again. The effect of  <em>HideCaret</em> is additive: if you call <em>HideCaret</em> several times without  calling <em>ShowCaret</em>, you must call <em>ShowCaret</em> the same number of  times before the caret becomes visible again.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/the-caret-functions-in-visual-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is Dead-Character Messages in Visual Programming</title>
		<link>http://vdiscussion.com/what-is-dead-character-messages-in-visual-programming/</link>
		<comments>http://vdiscussion.com/what-is-dead-character-messages-in-visual-programming/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 14:21:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[ANSI]]></category>
		<category><![CDATA[ASCII]]></category>
		<category><![CDATA[Dead-Character Messages]]></category>
		<category><![CDATA[WM_CHAR]]></category>
		<category><![CDATA[WM_DEADCHAR]]></category>
		<category><![CDATA[WM_SYSDEADCHAR]]></category>
		<category><![CDATA[wParam]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=59</guid>
		<description><![CDATA[Windows programs can usually ignore WM_DEADCHAR and WM_SYSDEADCHAR messages, but you should definitely know what dead characters are and how they work. On some non-U.S. English keyboards, certain keys are defined to add a diacritic to a letter. These are called &#8220;dead keys&#8221; because they don&#8217;t generate characters by themselves. For instance, when a German [...]]]></description>
			<content:encoded><![CDATA[<p>Windows programs can usually ignore <strong>WM_DEADCHAR</strong> and <strong>WM_SYSDEADCHAR</strong> messages,  but you should definitely know what dead characters are and how they work.</p>
<p>On some non-U.S. English keyboards, certain keys are defined to add a  diacritic to a letter. These are called &#8220;dead keys&#8221; because they don&#8217;t generate  characters by themselves. For instance, when a German keyboard is installed, the  key that is in the same position as the +/= key on a U.S. keyboard is a dead key  for the grave accent (`) when shifted and the acute accent (´) when unshifted.</p>
<p>When a user presses this dead key, your window procedure receives a  <strong>WM_DEADCHAR</strong> message with <strong><em>wParam</em></strong> equal to ASCII or Unicode code for the  diacritic by itself. When the user then presses a letter key that can be written  with this diacritic (for instance, the A key), the window procedure receives a  <strong>WM_CHAR</strong> message where <em>wParam</em> is the ANSI code for the letter `a&#8217; with the  diacritic.</p>
<p>Thus, your program does not have to process the <strong>WM_DEADCHAR</strong> message because  the <strong>WM_CHAR</strong> message gives the program all the information it needs. The Windows  logic even has built-in error handling: If the dead key is followed by a letter  that can&#8217;t take a diacritic (such as `s&#8217;), the window procedure receives two <strong> WM_CHAR</strong> messages in a row—the first with <em>wParam</em> equal to the <strong>ASCII</strong> code  for the diacritic by itself (the same <em>wParam</em> value delivered with the  WM_DEADCHAR message) and the second with <em>wParam</em> equal to the <strong>ASCII</strong> code  for the letter `s&#8217;.</p>
<p>Of course, the best way to get a feel for this is to see it in action. You  need to load a foreign keyboard that uses dead keys, such as the German keyboard  that I described earlier. You do this in the Control Panel by selecting Keyboard  and then the Language tab. Then you need an application that shows you the  details of every keyboard message a program can receive.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/what-is-dead-character-messages-in-visual-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is Keystrokes and Characters in Visual Programming</title>
		<link>http://vdiscussion.com/what-is-keystrokes-and-characters-in-visual-programming/</link>
		<comments>http://vdiscussion.com/what-is-keystrokes-and-characters-in-visual-programming/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 14:08:54 +0000</pubDate>
		<dc:creator>albert</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[Characters]]></category>
		<category><![CDATA[Keystrokes]]></category>
		<category><![CDATA[What is Characters]]></category>
		<category><![CDATA[What is Keystrokes]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=57</guid>
		<description><![CDATA[The messages that an application receives from Windows about keyboard events distinguish between keystrokes and characters. This is in accordance with the two ways you can view the keyboard. First, you can think of the keyboard as a collection of keys. The keyboard has only one key labeled &#8220;A.&#8221; Pressing that key is a keystroke. [...]]]></description>
			<content:encoded><![CDATA[<p>The messages that an application receives from Windows about keyboard events  distinguish between keystrokes and characters. This is in accordance with the  two ways you can view the keyboard.</p>
<p>First, you can think of the keyboard as a collection of keys. The keyboard  has only one key labeled &#8220;A.&#8221; Pressing that key is a keystroke. Releasing that  key is also considered a keystroke. But the keyboard is also an input device  that generates displayable characters or control characters. The &#8220;A&#8221; key can  generate several different characters depending on the status of the Ctrl,  Shift, and Caps Lock keys. Normally, the character is a lowercase &#8220;a.&#8221; If the  Shift key is down or Caps Lock is toggled on, the character is an uppercase &#8220;A.&#8221;  If Ctrl is down, the character is a Ctrl-A (which has meaning in ASCII but in  Windows is probably a keyboard accelerator if anything). On some keyboards, the  &#8220;A&#8221; keystroke might be preceded by a dead-character key or by Shift, Ctrl, or  Alt in various combinations. The combinations could generate a lowercase or  uppercase letter with an accent mark, such as à, á, â, ã, Ä, or Å.</p>
<p>For keystroke combinations that result in displayable characters, Windows  sends a program both keystroke messages and character messages. Some keys do not  generate characters. These include the shift keys, the function keys, the cursor  movement keys, and special keys such as Insert and Delete. For these keys,  Windows generates only keystroke messages.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/what-is-keystrokes-and-characters-in-visual-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is Queues and Synchronization in Visual Programming</title>
		<link>http://vdiscussion.com/what-is-queues-and-synchronization-in-visual-programming/</link>
		<comments>http://vdiscussion.com/what-is-queues-and-synchronization-in-visual-programming/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 12:42:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[Queues]]></category>
		<category><![CDATA[Synchronization]]></category>
		<category><![CDATA[Synchronization in Visual Programming]]></category>
		<category><![CDATA[System Mmessage Queue]]></category>
		<category><![CDATA[What is Queues]]></category>
		<category><![CDATA[What is Synchronization]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=54</guid>
		<description><![CDATA[As the user presses and releases keys on the keyboard, Windows and the keyboard device driver translate the hardware scan codes into formatted messages. However, these messages are not placed in an application&#8217;s message queue right away. Instead, Windows stores these messages in something called the system message queue. The system message queue is a [...]]]></description>
			<content:encoded><![CDATA[<p>As the user presses and releases keys on the keyboard, Windows and the  keyboard device driver translate the hardware scan codes into formatted  messages. However, these messages are not placed in an application&#8217;s message  queue right away. Instead, Windows stores these messages in something called the  <em>system message queue</em>. The system message queue is a single message queue  maintained by Windows specifically for the preliminary storage of user input  from the keyboard and the mouse. Windows will take the next message from the  system message queue and place it in an application&#8217;s message queue only when a  Windows application has finished processing a previous user input message.</p>
<p>The reasons for this two-step process—storing messages first in the system  message queue and then passing them to the application message queue—involves  synchronization. As we just learned, the window that is supposed to receive  keyboard input is the window with the input focus. A user can be typing faster  than an application can handle the keystrokes, and a particular keystroke might  have the effect of switching focus from one window to another. Subsequent  keystrokes should then go to another window. But they won&#8217;t if the subsequent  keystrokes have already been addressed with a destination window and placed in  an application message queue.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/what-is-queues-and-synchronization-in-visual-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is Valid and Invalid Rectangles in Visual Programming</title>
		<link>http://vdiscussion.com/what-is-valid-and-invalid-rectangles-in-visual-programming/</link>
		<comments>http://vdiscussion.com/what-is-valid-and-invalid-rectangles-in-visual-programming/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 13:37:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[BeginPaint]]></category>
		<category><![CDATA[GetUpdateRect]]></category>
		<category><![CDATA[invalid region]]></category>
		<category><![CDATA[paint information structure]]></category>
		<category><![CDATA[update region]]></category>
		<category><![CDATA[ValidateRect]]></category>
		<category><![CDATA[WM_PAINT]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=37</guid>
		<description><![CDATA[Window procedure should be prepared to update the entire client area whenever it receives a WM_PAINT message, it often needs to update only a smaller area, most often a rectangular area within the client area. This is most obvious when a dialog box overlies part of the client area. Repainting is required only for the [...]]]></description>
			<content:encoded><![CDATA[<p>Window procedure should be prepared to update the entire client area whenever it  receives a <strong>WM_PAINT</strong> message, it often needs to update only a smaller area, most  often a rectangular area within the client area. This is most obvious when a  dialog box overlies part of the client area. Repainting is required only for the  rectangular area uncovered when the dialog box is removed.</p>
<p>That area is known as an &#8220;<strong>invalid region</strong>&#8221; or &#8220;<strong>update region</strong>.&#8221; The presence of  an invalid region in a client area is what prompts Windows to place a <strong>WM_PAINT</strong> message in the application&#8217;s message queue. Your window procedure receives a  <strong>WM_PAINT</strong> message only if part of your client area is invalid.</p>
<p>Windows internally maintains a &#8220;<em>paint information structure</em>&#8221; for each window.  This structure contains, among other information, the coordinates of the  smallest rectangle that encompasses the invalid region. This is known as the  &#8220;invalid rectangle.&#8221; If another region of the client area becomes invalid before  the window procedure processes a pending <strong>WM_PAINT</strong> message, Windows calculates a  new invalid region (and a new invalid rectangle) that encompasses both areas and  stores this updated information in the paint information structure. Windows does  not place multiple <strong>WM_PAINT </strong>messages in the message queue.</p>
<p>A window procedure can invalidate a rectangle in its own client area by  calling <em>InvalidateRect</em>. If the message queue already contains a WM_PAINT  message, Windows calculates a new invalid rectangle. Otherwise, it places a  WM_PAINT message in the message queue. A window procedure can obtain the  coordinates of the invalid rectangle when it receives a WM_PAINT message (as  we&#8217;ll see later in this chapter). It can also obtain these coordinates at any  other time by calling <strong><em>GetUpdateRect</em></strong>.</p>
<p>After the window procedure calls <strong><em>BeginPaint</em></strong> during the WM_PAINT  message, the entire client area is validated. A program can also validate any  rectangular area within the client area by calling the <em>ValidateRect</em> function. If this call has the effect of validating the entire invalid area,  then any WM_PAINT message currently in the queue is removed.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/what-is-valid-and-invalid-rectangles-in-visual-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WM_PAINT Message Visual Programming</title>
		<link>http://vdiscussion.com/wm_paint-message-visual-programming/</link>
		<comments>http://vdiscussion.com/wm_paint-message-visual-programming/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 13:01:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[CS_HREDRAW]]></category>
		<category><![CDATA[CW_VREDRAW]]></category>
		<category><![CDATA[ScrollDC function]]></category>
		<category><![CDATA[ScrollWindow function]]></category>
		<category><![CDATA[UpdateWindow]]></category>
		<category><![CDATA[WinMain]]></category>
		<category><![CDATA[WM PAINT]]></category>
		<category><![CDATA[WM_PAINT]]></category>
		<category><![CDATA[WM_PAINT Function]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=34</guid>
		<description><![CDATA[Windows programs call the function UpdateWindow during initialization in WinMain shortly before entering the message loop. Windows takes this opportunity to send the window procedure its first WM_PAINT message. This message informs the window procedure that the client area must be painted. Thereafter, that window procedure should be ready at almost any time to process [...]]]></description>
			<content:encoded><![CDATA[<p>Windows programs call the function <strong><em>UpdateWindow</em></strong> during  initialization in <strong><em>WinMain</em></strong> shortly before entering the message loop.  Windows takes this opportunity to send the window procedure its first <strong>WM_PAINT</strong> message. This message informs the window procedure that the client area must be  painted. Thereafter, that window procedure should be ready at almost any time to  process additional <strong>WM_PAINT</strong> messages and even to repaint the entire client area  of the window if necessary. A window procedure receives a WM_PAINT message  whenever one of the following events occurs:</p>
<ul>
<li>A previously hidden area of the window is brought into view when a user  moves a window or uncovers a window.</li>
<li>The user resizes the window (if the window class style has the <strong>CS_HREDRAW</strong> and <strong>CW_VREDRAW</strong> bits set).</li>
<li>The program uses the <em>ScrollWindow</em> or <em>ScrollDC</em> function to  scroll part of its client area.</li>
<li>The program uses the <em>InvalidateRect</em> or <em>InvalidateRgn</em> function  to explicitly generate a <em>WM_PAINT</em> message.</li>
</ul>
<p>In some cases when part of the client area is temporarily written over,  Windows attempts to save an area of the display and restore it later. This is  not always successful. Windows may sometimes post a <strong>WM_PAINT</strong> message when:</p>
<ul>
<li>Windows removes a dialog box or message box that was overlaying part of the  window.</li>
<li>A menu is pulled down and then released.</li>
<li>A tool tip is displayed.</li>
</ul>
<p>In a few cases, Windows always saves the area of the display it overwrites  and then restores it. This is the case whenever:</p>
<ul>
<li>The mouse cursor is moved across the client area.</li>
<li>An icon is dragged across the client area.</li>
</ul>
<p>Dealing with <strong>WM_PAINT</strong> message requires that you alter the way you think about  how you write to the video display. Your program should be structured so that it  accumulates all the information necessary to paint the client area but paints  only &#8220;on demand&#8221;—when Windows sends the window procedure a <strong>WM_PAINT</strong> message. If  your program needs to update its client area at some other time, it can force  Windows to generate this <strong>WM_PAINT</strong> message. This may seem a roundabout method of  displaying something on the screen, but the structure of your program will  benefit from it.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/wm_paint-message-visual-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Create the Window in Visual Programming C++</title>
		<link>http://vdiscussion.com/how-to-create-the-window-in-visual-programming-c/</link>
		<comments>http://vdiscussion.com/how-to-create-the-window-in-visual-programming-c/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 14:51:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[CreateWindow()]]></category>
		<category><![CDATA[CW_USEDEFAULT]]></category>
		<category><![CDATA[program instance handle]]></category>
		<category><![CDATA[RegisterClass]]></category>
		<category><![CDATA[szAppName]]></category>
		<category><![CDATA[window menu handle]]></category>
		<category><![CDATA[WinMain]]></category>
		<category><![CDATA[WS_OVERLAPPEDWINDOW]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=32</guid>
		<description><![CDATA[The window class defines general characteristics of a window. By using that window class we can create many different windows. We can create a window by calling CreateWindow. Programmers new to Windows are sometimes confused about the distinction between the window class and the window and why all the characteristics of a window can&#8217;t be [...]]]></description>
			<content:encoded><![CDATA[<p>The window class defines general characteristics of a window. By using that window class we can create many different windows. We can create a window by calling <strong><em>CreateWindow.</em></strong></p>
<p>Programmers new to Windows are sometimes confused about the distinction  between the window class and the window and why all the characteristics of a  window can&#8217;t be specified in one shot. Actually, dividing the information in  this way is quite convenient. <em>For example</em>, all push-button windows are created  based on the same window class. The window procedure associated with this window  class is located inside Windows itself, and it is responsible for processing  keyboard and mouse input to the push button and defining the button&#8217;s visual  appearance on the screen. All push buttons work the same way in this respect.  But not all push buttons are the same. They almost certainly have different  sizes, different locations on the screen, and different text strings. These  latter characteristics are part of the window definition rather than the window  class definition.</p>
<p>While the information passed to the <em>RegisterClass</em> function is specified  in a data structure, the information passed to the <em>CreateWindow</em> function  is specified as separate arguments to the function. Here&#8217;s the  <em>CreateWindow</em> call</p>
<blockquote><p><strong>hwnd = CreateWindow (szAppName,                  // window class name<br />
TEXT (&#8220;The Hello Program&#8221;), // window caption<br />
WS_OVERLAPPEDWINDOW,        // window style<br />
CW_USEDEFAULT,              // initial x position<br />
CW_USEDEFAULT,              // initial y position<br />
CW_USEDEFAULT,              // initial x size<br />
CW_USEDEFAULT,              // initial y size<br />
NULL,                       // parent window handle<br />
NULL,                       // window menu handle<br />
hInstance,                  // program instance handle<br />
NULL) ;                     // creation parameters</strong></p></blockquote>
<p><strong>szAppName</strong> &#8212; &gt; &#8220;window class name&#8221;. The name of the window class the program just registered</p>
<p>The window created by this program is a normal overlapped window. It will have a title bar; a system menu button to the left of the title bar; a thick window-sizing border; and minimize, maximize, and close buttons to the right of the title bar. That&#8217;s a standard style for windows, and it has the name <strong>WS_OVERLAPPEDWINDOW</strong>, which appears as the &#8220;window style&#8221; parameter in CreateWindow. If you look in <em>WINUSER.H</em>, you&#8217;ll find that this style is a combination of several bit flags:</p>
<p><strong>#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED     | \<br />
WS_CAPTION        | \<br />
WS_SYSMENU        | \<br />
WS_THICKFRAME     | \<br />
WS_MINIMIZEBOX    | \<br />
WS_MAXIMIZEBOX)</strong><br />
The &#8220;<em>window caption</em>&#8221; is the text that will appear in the title bar of the window.</p>
<p>The arguments marked &#8220;<strong>initial x position</strong>&#8221; and &#8220;<strong>initial y position</strong>&#8221; specify the initial position of the upper left corner of the window relative to the upper left corner of the screen. By using the identifier <strong>CW_USEDEFAULT</strong> for these parameters, we are indicating that we want Windows to use the default position for an overlapped window. (<strong>CW_USEDEFAULT</strong> is defined as <strong>0&#215;80000000</strong>.) By default, Windows positions successive newly created windows at stepped horizontal and vertical offsets from the upper left corner of the display. Similarly, the &#8220;<strong>initial x size</strong>&#8221; and &#8220;<strong>initial y size</strong>&#8221; arguments specify the initial width and height of the window. The <strong>CW_USEDEFAULT</strong> identifier again indicates that we want Windows to use a default size for the window.</p>
<p>The argument marked &#8220;<strong>parent window handle</strong>&#8221; is set to NULL when creating a  &#8220;top-level&#8221; window, such as an application window. Normally, when a parent-child  relationship exists between two windows, the child window always appears on the  surface of its parent. An application window appears on the surface of the  desktop window, but you don&#8217;t need to find out the desktop window&#8217;s handle to  call <strong><em>CreateWindow</em></strong>.</p>
<p>The &#8220;<strong>window menu handle</strong>&#8221; is also set to NULL because the window has no menu.  The &#8220;<strong>program instance handle</strong>&#8221; is set to the instance handle passed to the  program as a parameter of <em>WinMain</em>. Finally, a &#8220;creation parameters&#8221;  pointer is set to NULL. You could use this parameter to point to some data that  you might later want to reference in your program.</p>
<p>The <em>CreateWindow</em> call returns a handle to the created window. This  handle is saved in the variable <em>hwnd</em>, which is defined to be of type HWND  (&#8220;handle to a window&#8221;). Every window in Windows has a handle. Your program uses  the handle to refer to the window. Many Windows functions require <em>hwnd</em> as  an argument so that Windows knows which window the function applies to. If a  program creates many windows, each has a different handle. The handle to a  window is one of the most important handles that a Windows program (pardon the  expression) handles.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/how-to-create-the-window-in-visual-programming-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MessageBox Function Visual Programming</title>
		<link>http://vdiscussion.com/messagebox-function-visual-programming/</link>
		<comments>http://vdiscussion.com/messagebox-function-visual-programming/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 05:31:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[hWnd]]></category>
		<category><![CDATA[lpCaption]]></category>
		<category><![CDATA[lpText]]></category>
		<category><![CDATA[MessageBox]]></category>
		<category><![CDATA[MessageBox syntax]]></category>
		<category><![CDATA[uType]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=27</guid>
		<description><![CDATA[The MessageBox function is designed to display short messages. Syntax int MessageBox( HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType ); Parameters hWnd &#8211;&#62; Handle to the owner window of the message box to be created. If this parameter is NULL, the message box has no owner window. lpText &#8211;&#62; Pointer to a null-terminated string [...]]]></description>
			<content:encoded><![CDATA[<p>The <strong><em>MessageBox</em></strong> function is designed to display short messages.</p>
<p><strong>Syntax</strong></p>
<blockquote><p>int MessageBox(<br />
HWND hWnd,<br />
LPCTSTR lpText,<br />
LPCTSTR lpCaption,<br />
UINT uType<br />
);</p></blockquote>
<p><strong>Parameters</strong></p>
<p><strong>hWnd</strong> &#8211;&gt; Handle to the <em>owner window of the message box to be created</em>. If this parameter is NULL, the message box has no owner window.</p>
<p><strong>lpText</strong> &#8211;&gt; Pointer to a null-terminated string that <em>contains the message to be displayed</em>. If the string consists of more than one line, you can separate the lines using a carriage return and/or linefeed character between each line.</p>
<p><strong>lpCaption</strong> &#8211;&gt; Pointer to a null-terminated string that <em>contains the dialog box title</em>. If this parameter is NULL, the default title is Error.</p>
<p><strong>uType</strong> &#8211;&gt; Specifies the contents and behavior of the dialog box. This parameter can be a combination of flags from the following groups of flags.</p>
<p>You can pick one constant from the first set to indicate what buttons you wish to appear in the dialog box:</p>
<ul>
<li>#define MB_OK                       0x00000000L</li>
<li>#define MB_OKCANCEL                 0x00000001L</li>
<li>#define MB_ABORTRETRYIGNORE         0x00000002L</li>
<li>#define MB_YESNOCANCEL              0x00000003L</li>
<li>#define MB_YESNO                    0x00000004L</li>
<li>#define MB_RETRYCANCEL              0x00000005L</li>
</ul>
<p>When you set the fourth argument to 0 in HELLOMSG, only the OK button appears.</p>
<p><strong>Return Value</strong></p>
<p>If a message box has a <strong>Cancel</strong> button, the function returns the IDCANCEL value if either the ESC key is pressed or the <strong>Cancel</strong> button is selected. If the message box has no <strong>Cancel</strong> button, pressing ESC has no effect.</p>
<p>If the function fails, the return value is zero. To get extended error information, call GetLastError</p>
<p>If the function succeeds, the return value is one of the following menu-item values.</p>
<table style="height: 166px;" border="0" cellpadding="0" width="273">
<tbody>
<tr>
<td>IDABORT</td>
<td><strong>Abort</strong> button was selected.</td>
</tr>
<tr>
<td>IDCANCEL</td>
<td><strong>Cancel</strong> button was selected.</td>
</tr>
<tr>
<td>IDCONTINUE</td>
<td><strong>Continue</strong> button was selected.</td>
</tr>
<tr>
<td>IDIGNORE</td>
<td><strong>Ignore</strong> button was selected.</td>
</tr>
<tr>
<td>IDNO</td>
<td><strong>No</strong> button   was selected.</td>
</tr>
<tr>
<td>IDOK</td>
<td><strong>OK</strong> button   was selected.</td>
</tr>
<tr>
<td>IDRETRY</td>
<td><strong>Retry</strong> button was selected.</td>
</tr>
<tr>
<td>IDTRYAGAIN</td>
<td><strong>Try Again</strong> button was selected.</td>
</tr>
<tr>
<td>IDYES</td>
<td><strong>Yes</strong> button   was selected.</td>
</tr>
</tbody>
</table>
<blockquote><p>#include &lt;windows.h&gt;</p>
<p>int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,<br />
PSTR szCmdLine, int iCmdShow)<br />
{<br />
MessageBox (NULL, TEXT (&#8220;Hello, vdiscussion.com&#8221;), TEXT (&#8220;Vdiscussion.com&#8221;), 0) ;</p>
<p>return 0 ;<br />
}</p></blockquote>
<p><strong>Output</strong></p>
<div id="attachment_28" class="wp-caption alignnone" style="width: 148px"><img class="size-full wp-image-28" title="Helloprogramoutput" src="http://vdiscussion.com/wp-content/uploads/2009/10/Helloprogramoutput.JPG" alt="Helloprogramoutput" width="138" height="100" /><p class="wp-caption-text">Helloprogramoutput</p></div>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/messagebox-function-visual-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
