<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://www.fsdeveloper.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Narutokun-8877</id>
	<title>FSDeveloper Wiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="http://www.fsdeveloper.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Narutokun-8877"/>
	<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php/Special:Contributions/Narutokun-8877"/>
	<updated>2026-05-05T11:25:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Direct2D_Gauges&amp;diff=8731</id>
		<title>Direct2D Gauges</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Direct2D_Gauges&amp;diff=8731"/>
		<updated>2013-02-27T19:39:59Z</updated>

		<summary type="html">&lt;p&gt;Narutokun-8877: New page: {{Infobox-Applicable-FSVersion | FSXI = true | FSXA = true | FSX = true | FS2004 = false | FS2002 = false }}  Despite FSX being a DirectX 9 program and Direct2D being part of DirectX 10/11...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox-Applicable-FSVersion&lt;br /&gt;
| FSXI = true&lt;br /&gt;
| FSXA = true&lt;br /&gt;
| FSX = true&lt;br /&gt;
| FS2004 = false&lt;br /&gt;
| FS2002 = false&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Despite FSX being a DirectX 9 program and Direct2D being part of DirectX 10/11, it is possible to use it as a gauge drawing method in conjunction with GDI/GDI+(In other words, you can mix the 2) in FSX. Here is how it is done:&lt;br /&gt;
&lt;br /&gt;
First of all, define the following pointers along with any other pens/brushes/bitmaps or other D2D objects you want to use. These 2 are vital though:&lt;br /&gt;
&lt;br /&gt;
 ID2D1Factory* pD2DFactory = NULL;&lt;br /&gt;
 ID2D1DCRenderTarget* pRT = NULL;&lt;br /&gt;
&lt;br /&gt;
In your PANEL_SERVICE_CONNECT_TO_WINDOW (or gauge class constructor if using the ESP example as a template), initialize your ID2D1Factory object and your ID2D1DCRenderTarget as well as initializing any other objects:&lt;br /&gt;
&lt;br /&gt;
 //Initialize the ID2D1Factory object&lt;br /&gt;
 D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &amp;amp;pD2DFactory);&lt;br /&gt;
 //initialize the ID2D1DCRenderTarget&lt;br /&gt;
 D2D1_RENDER_TARGET_PROPERTIES props = D2D1::RenderTargetProperties(&lt;br /&gt;
 D2D1_RENDER_TARGET_TYPE_DEFAULT,&lt;br /&gt;
 D2D1::PixelFormat(&lt;br /&gt;
 	DXGI_FORMAT_B8G8R8A8_UNORM,&lt;br /&gt;
 	D2D1_ALPHA_MODE_PREMULTIPLIED),&lt;br /&gt;
 	0,&lt;br /&gt;
 	0,&lt;br /&gt;
 	D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE,&lt;br /&gt;
 	D2D1_FEATURE_LEVEL_DEFAULT&lt;br /&gt;
 	);&lt;br /&gt;
 pD2DFactory-&amp;gt;CreateDCRenderTarget(&amp;amp;props, &amp;amp;pRT);&lt;br /&gt;
&lt;br /&gt;
Then, in your PANEL_SERVICE_POST_INSTALL call, link the ID2D1DCRenderTarget with the hDC of the gauge(it will be relinked with any gauge resize)&lt;br /&gt;
&lt;br /&gt;
 RECT rct;&lt;br /&gt;
 rct.top = 0;&lt;br /&gt;
 rct.left = 0;&lt;br /&gt;
 rct.right = tempX;//Width of the gauge&lt;br /&gt;
 rct.bottom = tempY;//Height of the gauge&lt;br /&gt;
 pRT-&amp;gt;BindDC(element-&amp;gt;hdc, &amp;amp;rct);&lt;br /&gt;
&lt;br /&gt;
Then in order to draw, place all your D2D drawing code between these 2 lines&lt;br /&gt;
&lt;br /&gt;
 pRT-&amp;gt;BeginDraw();&lt;br /&gt;
 &lt;br /&gt;
 pRT-&amp;gt;EndDraw();&lt;br /&gt;
&lt;br /&gt;
Finally, to close down Direct2D, place this in your PANEL_SERVICE_DISCONNECT or class destructor (if using the ESP GDI+ example as a template)&lt;br /&gt;
&lt;br /&gt;
 if(pRT)&lt;br /&gt;
  pRT-&amp;gt;Release();&lt;br /&gt;
 //Release the other Direct2D objects you have created as well&lt;br /&gt;
 if(pD2DFactory)&lt;br /&gt;
  pD2DFactory-&amp;gt;Release();&lt;br /&gt;
&lt;br /&gt;
Thats it. Enjoy!&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft Design]]&lt;br /&gt;
[[Category:Panel and Gauge Design]]&lt;/div&gt;</summary>
		<author><name>Narutokun-8877</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=FSX_Popup_windows&amp;diff=8730</id>
		<title>FSX Popup windows</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=FSX_Popup_windows&amp;diff=8730"/>
		<updated>2013-02-27T19:12:21Z</updated>

		<summary type="html">&lt;p&gt;Narutokun-8877: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox-Applicable-FSVersion&lt;br /&gt;
| FSXI = false&lt;br /&gt;
| FSXA = true&lt;br /&gt;
| FSX = false&lt;br /&gt;
| FS2004 = false&lt;br /&gt;
| FS2002 = false&lt;br /&gt;
| XP10 = false &lt;br /&gt;
| XP9 = false &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a short tutorial on how to create popup windows from a C++ gauge or SimConnect module dll. Do note that i will not be going into where to execute the creation functions from the gauge or SimConnect dll.&lt;br /&gt;
&lt;br /&gt;
First off, in your header file, add the following declarations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;windows.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;process.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 bool CreateWin();&lt;br /&gt;
 bool ExitWin();&lt;br /&gt;
 DWORD WINAPI WinThread(LPVOID lpParam);&lt;br /&gt;
 bool RegisterWin();&lt;br /&gt;
 LRESULT CALLBACK WinQueue(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);&lt;br /&gt;
 //Replace Win with any identifier name you want&lt;br /&gt;
&lt;br /&gt;
Then, in your cpp file, create the thread that the window message cue will be run from.&lt;br /&gt;
&lt;br /&gt;
 bool CreateWin()&lt;br /&gt;
 {&lt;br /&gt;
 	CreateThread(0, NULL, WinThread, NULL, NULL, NULL);&lt;br /&gt;
 	return true;&lt;br /&gt;
 //returns true so that you can know that you have sent the command to open the new window&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Also create a function to call to shut down the window(This window does come with a little red box in the upper right corner so this function is just an alternative(also can be called on shutdown)).&lt;br /&gt;
&lt;br /&gt;
 bool ExitWin()&lt;br /&gt;
 {&lt;br /&gt;
 	SendMessage(hwnd, WM_CLOSE, 0, 0);&lt;br /&gt;
 	return false;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Next is your function to register the class. Note that i have made it a template of the FS98FLOAT class to save some code lines.&lt;br /&gt;
&lt;br /&gt;
 bool RegisterWin()&lt;br /&gt;
 {&lt;br /&gt;
 	WNDCLASSW wc;	&lt;br /&gt;
 	memset(&amp;amp;wc,0,sizeof(WNDCLASS));&lt;br /&gt;
 	if(GetClassInfo(NULL, L&amp;quot;FS98FLOAT&amp;quot;, &amp;amp;wc))&lt;br /&gt;
 	{&lt;br /&gt;
 		wc.lpszClassName = L&amp;quot;MYFLOAT&amp;quot;;//Choose your class name&lt;br /&gt;
 		wc.hInstance = GetModuleHandle(L&amp;quot;MY_DLL.dll&amp;quot;);//place your dll name here&lt;br /&gt;
 		wc.lpfnWndProc = (WNDPROC) WinQueue;//Your message que function&lt;br /&gt;
 		wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);&lt;br /&gt;
 		if(RegisterClass(&amp;amp;wc))&lt;br /&gt;
 			return true;&lt;br /&gt;
 		else&lt;br /&gt;
 			return false;&lt;br /&gt;
 	}&lt;br /&gt;
 	else&lt;br /&gt;
 		return false;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
And now your thread function&lt;br /&gt;
&lt;br /&gt;
 DWORD WINAPI ACMProc(LPVOID lpParam)&lt;br /&gt;
 {&lt;br /&gt;
 	MSG msg;&lt;br /&gt;
 	RegisterWin();//Register the class&lt;br /&gt;
 	hwnd = CreateWindowEx(&lt;br /&gt;
 				WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR |  WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE,//necessary styles etc&lt;br /&gt;
 				L&amp;quot;MYFLOAT&amp;quot;, // Your class name				 				L&amp;quot;My Window&amp;quot;,//Window caption&lt;br /&gt;
 				WS_CAPTION | WS_POPUP | WS_CLIPSIBLINGS | WS_SYSMENU |  WS_THICKFRAME,//necessary styles etc&lt;br /&gt;
 				0,0, 800,600,//Window position/Dimensions&lt;br /&gt;
 				FindWindow(L&amp;quot;FS98MAIN&amp;quot;, L&amp;quot;Microsoft Flight Simulator X&amp;quot;),//The Parent  window&lt;br /&gt;
 				NULL,&lt;br /&gt;
 				GetModuleHandle(L&amp;quot;MY_DLL.dll&amp;quot;),&lt;br /&gt;
 				NULL );&lt;br /&gt;
 	ShowWindow (hwnd, SW_SHOWNORMAL);//Shows the window&lt;br /&gt;
 	while (GetMessage (&amp;amp;msg, NULL, 0, 0))&lt;br /&gt;
 	{&lt;br /&gt;
 		TranslateMessage(&amp;amp;msg);&lt;br /&gt;
 		DispatchMessage(&amp;amp;msg);&lt;br /&gt;
 	}&lt;br /&gt;
 	return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
And finally, the message cue. You can do pretty much whatever you want from here out&lt;br /&gt;
&lt;br /&gt;
 LRESULT CALLBACK ACMQueue(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)&lt;br /&gt;
 {&lt;br /&gt;
 	switch(message)&lt;br /&gt;
 	{&lt;br /&gt;
 		case WM_CREATE:							// sent by the  windows system just before the window will be displayed the first time&lt;br /&gt;
 &lt;br /&gt;
 			// here is the best location to prepare your window i.e. connecting to SimConnect&lt;br /&gt;
 &lt;br /&gt;
 			break;&lt;br /&gt;
 		case WM_ERASEBKGND:					    // sent by windows if t he entire window will be renewed.&lt;br /&gt;
 			break;								// if y ou create your own background, do it here in and return (1) instead using &#039;break&#039;&lt;br /&gt;
 		case WM_PAINT:&lt;br /&gt;
 			{&lt;br /&gt;
 				PAINTSTRUCT ps;&lt;br /&gt;
 				HDC hdc;&lt;br /&gt;
 				wchar_t *WinOutput[] = {{L&amp;quot;Hello World!&amp;quot;},{L&amp;quot;This window was created  out of a DLL.&amp;quot;}};&lt;br /&gt;
 	 			hdc = BeginPaint(hwnd, &amp;amp;ps);   // now we have a valid device context to  modify the window&#039;s content&lt;br /&gt;
 				TextOut(hdc,20,20,WinOutput[0],wcslen(WinOutput[0]));&lt;br /&gt;
 				MoveToEx(hdc,20,40,NULL);&lt;br /&gt;
 				LineTo(hdc,120,40);&lt;br /&gt;
 				TextOut(hdc,20,60,WinOutput[1],wcslen(WinOutput[1]));&lt;br /&gt;
 				// do all drawing of your window  here in&lt;br /&gt;
 &lt;br /&gt;
 				EndPaint(hwnd,&amp;amp;ps);&lt;br /&gt;
 			}&lt;br /&gt;
 			break;&lt;br /&gt;
 		case WM_DESTROY:		// sent by the windows system just before the window will be destroyed&lt;br /&gt;
 								// disconnect from SimConnect out of this message&lt;br /&gt;
 			break;&lt;br /&gt;
 		case WM_CLOSE:&lt;br /&gt;
 			break;&lt;br /&gt;
 	}&lt;br /&gt;
 	return (DefWindowProcA(hwnd, message, wParam, lParam));&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enjoy!!&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft Design]]&lt;br /&gt;
[[Category:Panel and Gauge Design]]&lt;/div&gt;</summary>
		<author><name>Narutokun-8877</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=FSX_Popup_windows&amp;diff=8728</id>
		<title>FSX Popup windows</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=FSX_Popup_windows&amp;diff=8728"/>
		<updated>2013-02-24T21:58:20Z</updated>

		<summary type="html">&lt;p&gt;Narutokun-8877: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox-Applicable-FSVersion&lt;br /&gt;
| FSXI = false&lt;br /&gt;
| FSXA = true&lt;br /&gt;
| FSX = false&lt;br /&gt;
| FS2004 = false&lt;br /&gt;
| FS2002 = false&lt;br /&gt;
| XP10 = false &lt;br /&gt;
| XP9 = false &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a short tutorial on how to create popup windows from a C++ gauge or SimConnect module dll. Do note that i will not be going into where to execute the creation functions from the gauge or SimConnect dll.&lt;br /&gt;
&lt;br /&gt;
First off, in your header file, add the following declarations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;windows.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;process.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 bool CreateWin();&lt;br /&gt;
 bool ExitWin();&lt;br /&gt;
 DWORD WINAPI WinThread(LPVOID lpParam);&lt;br /&gt;
 bool RegisterWin();&lt;br /&gt;
 LRESULT CALLBACK WinQueue(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);&lt;br /&gt;
 //Replace Win with any identifier name you want&lt;br /&gt;
&lt;br /&gt;
Then, in your cpp file, create the thread that the window message cue will be run from.&lt;br /&gt;
&lt;br /&gt;
 bool CreateWin()&lt;br /&gt;
 {&lt;br /&gt;
 	CreateThread(0, NULL, WinThread, NULL, NULL, NULL);&lt;br /&gt;
 	return true;&lt;br /&gt;
 //returns true so that you can know that you have sent the command to open the new window&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Also create a function to call to shut down the window(This window does come with a little red box in the upper right corner so this function is just an alternative(also can be called on shutdown)).&lt;br /&gt;
&lt;br /&gt;
 bool ExitWin()&lt;br /&gt;
 {&lt;br /&gt;
 	SendMessage(hwnd, WM_CLOSE, 0, 0);&lt;br /&gt;
 	return false;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Next is your function to register the class. Note that i have made it a template of the FS98FLOAT class to save some code lines.&lt;br /&gt;
&lt;br /&gt;
 bool RegisterWin()&lt;br /&gt;
 {&lt;br /&gt;
 	WNDCLASSW wc;	&lt;br /&gt;
 	memset(&amp;amp;wc,0,sizeof(WNDCLASS));&lt;br /&gt;
 	if(GetClassInfo(NULL, L&amp;quot;FS98FLOAT&amp;quot;, &amp;amp;wc))&lt;br /&gt;
 	{&lt;br /&gt;
 		wc.lpszClassName = L&amp;quot;MYFLOAT&amp;quot;;//Choose your class name&lt;br /&gt;
 		wc.hInstance = GetModuleHandle(L&amp;quot;MY_DLL.dll&amp;quot;);//place your dll name here&lt;br /&gt;
 		wc.lpfnWndProc = (WNDPROC) WinQueue;//Your message que function&lt;br /&gt;
 		wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);&lt;br /&gt;
 		if(RegisterClass(&amp;amp;wc))&lt;br /&gt;
 			return true;&lt;br /&gt;
 		else&lt;br /&gt;
 			return false;&lt;br /&gt;
 	}&lt;br /&gt;
 	else&lt;br /&gt;
 		return false;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
And now your thread function&lt;br /&gt;
&lt;br /&gt;
 DWORD WINAPI ACMProc(LPVOID lpParam)&lt;br /&gt;
 {&lt;br /&gt;
 	MSG msg;&lt;br /&gt;
 	RegisterWin();//Register the class&lt;br /&gt;
 	hwnd = CreateWindowEx(&lt;br /&gt;
 				WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR |  WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE,//necessary styles etc&lt;br /&gt;
 				L&amp;quot;MYFLOAT&amp;quot;, // Your class name				 				L&amp;quot;My Window&amp;quot;,//Window caption&lt;br /&gt;
 				WS_CAPTION | WS_POPUP | WS_CLIPSIBLINGS | WS_SYSMENU |  WS_THICKFRAME,//necessary styles etc&lt;br /&gt;
 				0,0, 800,600,//Window position/Dimensions&lt;br /&gt;
 				FindWindow(L&amp;quot;FS98MAIN&amp;quot;, L&amp;quot;Microsoft Flight Simulator X&amp;quot;),//The Parent  window&lt;br /&gt;
 				NULL,&lt;br /&gt;
 				GetModuleHandle(L&amp;quot;MY_DLL.dll&amp;quot;),&lt;br /&gt;
 				NULL );&lt;br /&gt;
 	ShowWindow (hwnd, SW_SHOWNORMAL);//Shows the window&lt;br /&gt;
 	while (GetMessage (&amp;amp;msg, NULL, 0, 0))&lt;br /&gt;
 	{&lt;br /&gt;
 		TranslateMessage(&amp;amp;msg);&lt;br /&gt;
 		DispatchMessage(&amp;amp;msg);&lt;br /&gt;
 	}&lt;br /&gt;
 	return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
And finally, the message cue. You can do pretty much whatever you want from here out&lt;br /&gt;
&lt;br /&gt;
 LRESULT CALLBACK ACMQueue(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)&lt;br /&gt;
 {&lt;br /&gt;
 	switch(message)&lt;br /&gt;
 	{&lt;br /&gt;
 		case WM_CREATE:							// sent by the  windows system just before the window will be displayed the first time&lt;br /&gt;
 &lt;br /&gt;
 			// here is the best location to prepare your window i.e. connecting to SimConnect&lt;br /&gt;
 &lt;br /&gt;
 			break;&lt;br /&gt;
 		case WM_ERASEBKGND:					    // sent by windows if t he entire window will be renewed.&lt;br /&gt;
 			break;								// if y ou create your own background, do it here in and return (1) instead using &#039;break&#039;&lt;br /&gt;
 		case WM_PAINT:&lt;br /&gt;
 			{&lt;br /&gt;
 				PAINTSTRUCT ps;&lt;br /&gt;
 				HDC hdc;&lt;br /&gt;
 				wchar_t *WinOutput[] = {{L&amp;quot;Hello World!&amp;quot;},{L&amp;quot;This window was created  out of a DLL.&amp;quot;}};&lt;br /&gt;
 	 			hdc = BeginPaint(hwnd, &amp;amp;ps);   // now we have a valid device context to  modify the window&#039;s content&lt;br /&gt;
 				TextOut(hdc,20,20,WinOutput[0],wcslen(WinOutput[0]));&lt;br /&gt;
 				MoveToEx(hdc,20,40,NULL);&lt;br /&gt;
 				LineTo(hdc,120,40);&lt;br /&gt;
 				TextOut(hdc,20,60,WinOutput[1],wcslen(WinOutput[1]));&lt;br /&gt;
 				// do all drawing of your window  here in&lt;br /&gt;
 &lt;br /&gt;
 				EndPaint(hwnd,&amp;amp;ps);&lt;br /&gt;
 			}&lt;br /&gt;
 			break;&lt;br /&gt;
 		case WM_DESTROY:		// sent by the windows system just before the window will be destroyed&lt;br /&gt;
 								// disconnect from SimConnect out of this message&lt;br /&gt;
 			break;&lt;br /&gt;
 		case WM_CLOSE:&lt;br /&gt;
 			break;&lt;br /&gt;
 	}&lt;br /&gt;
 	return (DefWindowProcA(hwnd, message, wParam, lParam));&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enjoy!!&lt;br /&gt;
&lt;br /&gt;
[[category:Panel and Gauge Design]]&lt;/div&gt;</summary>
		<author><name>Narutokun-8877</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=FSX_Popup_windows&amp;diff=8727</id>
		<title>FSX Popup windows</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=FSX_Popup_windows&amp;diff=8727"/>
		<updated>2013-02-24T21:53:35Z</updated>

		<summary type="html">&lt;p&gt;Narutokun-8877: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox-Applicable-FSVersion&lt;br /&gt;
| FSXI = false&lt;br /&gt;
| FSXA = true&lt;br /&gt;
| FSX = false&lt;br /&gt;
| FS2004 = false&lt;br /&gt;
| FS2002 = false&lt;br /&gt;
| XP10 = false &lt;br /&gt;
| XP9 = false &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a short tutorial on how to create popup windows from a C++ gauge or SimConnect module dll. Do note that i will not be going into where to execute the creation functions from the gauge or SimConnect dll.&lt;br /&gt;
&lt;br /&gt;
First off, in your header file, add the following declarations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;windows.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;process.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 bool CreateWin();&lt;br /&gt;
 bool ExitWin();&lt;br /&gt;
 DWORD WINAPI WinThread(LPVOID lpParam);&lt;br /&gt;
 bool RegisterWin();&lt;br /&gt;
 LRESULT CALLBACK WinQueue(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);&lt;br /&gt;
 //Replace Win with any identifier name you want&lt;br /&gt;
&lt;br /&gt;
Then, in your cpp file, create the thread that the window message cue will be run from.&lt;br /&gt;
&lt;br /&gt;
 bool CreateWin()&lt;br /&gt;
 {&lt;br /&gt;
 	CreateThread(0, NULL, WinThread, NULL, NULL, NULL);&lt;br /&gt;
 	return true;&lt;br /&gt;
 //returns true so that you can know that you have sent the command to open the new window&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Also create a function to call to shut down the window(This window does come with a little red box in the upper right corner so this function is just an alternative(also can be called on shutdown)).&lt;br /&gt;
&lt;br /&gt;
 bool ExitWin()&lt;br /&gt;
 {&lt;br /&gt;
 	SendMessage(hwnd, WM_CLOSE, 0, 0);&lt;br /&gt;
 	return false;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Next is your function to register the class. Note that i have made it a template of the FS98FLOAT class to save some code lines.&lt;br /&gt;
&lt;br /&gt;
 bool RegisterWin()&lt;br /&gt;
 {&lt;br /&gt;
 	WNDCLASSW wc;	&lt;br /&gt;
 	memset(&amp;amp;wc,0,sizeof(WNDCLASS));&lt;br /&gt;
 	if(GetClassInfo(NULL, L&amp;quot;FS98FLOAT&amp;quot;, &amp;amp;wc))&lt;br /&gt;
 	{&lt;br /&gt;
 		wc.lpszClassName = L&amp;quot;MYFLOAT&amp;quot;;//Choose your class name&lt;br /&gt;
 		wc.hInstance = GetModuleHandle(L&amp;quot;MY_DLL.dll&amp;quot;);//place your dll name here&lt;br /&gt;
 		wc.lpfnWndProc = (WNDPROC) WinQueue;//Your message que function&lt;br /&gt;
 		wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);&lt;br /&gt;
 		if(RegisterClass(&amp;amp;wc))&lt;br /&gt;
 			return true;&lt;br /&gt;
 		else&lt;br /&gt;
 			return false;&lt;br /&gt;
 	}&lt;br /&gt;
 	else&lt;br /&gt;
 		return false;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
And now your thread function&lt;br /&gt;
&lt;br /&gt;
 DWORD WINAPI ACMProc(LPVOID lpParam)&lt;br /&gt;
 {&lt;br /&gt;
 	MSG msg;&lt;br /&gt;
 	RegisterWin();//Register the class&lt;br /&gt;
 	hwnd = CreateWindowEx(&lt;br /&gt;
 				WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR |  WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE,//necessary styles etc&lt;br /&gt;
 				L&amp;quot;MYFLOAT&amp;quot;, // Your class name				 				L&amp;quot;My Window&amp;quot;,//Window caption&lt;br /&gt;
 				WS_CAPTION | WS_POPUP | WS_CLIPSIBLINGS | WS_SYSMENU |  WS_THICKFRAME,//necessary styles etc&lt;br /&gt;
 				0,0, 800,600,//Window position/Dimensions&lt;br /&gt;
 				FindWindow(L&amp;quot;FS98MAIN&amp;quot;, L&amp;quot;Microsoft Flight Simulator X&amp;quot;),//The Parent  window&lt;br /&gt;
 				NULL,&lt;br /&gt;
 				GetModuleHandle(L&amp;quot;My_DLL.dll&amp;quot;),&lt;br /&gt;
 				NULL );&lt;br /&gt;
 	ShowWindow (hwnd, SW_SHOWNORMAL);//Shows the window&lt;br /&gt;
 	while (GetMessage (&amp;amp;msg, NULL, 0, 0))&lt;br /&gt;
 	{&lt;br /&gt;
 		TranslateMessage(&amp;amp;msg);&lt;br /&gt;
 		DispatchMessage(&amp;amp;msg);&lt;br /&gt;
 	}&lt;br /&gt;
 	return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
And finally, the message cue. You can do pretty much whatever you want from here out&lt;br /&gt;
&lt;br /&gt;
 LRESULT CALLBACK ACMQueue(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)&lt;br /&gt;
 {&lt;br /&gt;
 	switch(message)&lt;br /&gt;
 	{&lt;br /&gt;
 		case WM_CREATE:							// sent by the  windows system just before the window will be displayed the first time&lt;br /&gt;
 &lt;br /&gt;
 			// here is the best location to prepare your window i.e. connecting to SimConnect&lt;br /&gt;
 &lt;br /&gt;
 			break;&lt;br /&gt;
 		case WM_ERASEBKGND:					    // sent by windows if t he entire window will be renewed.&lt;br /&gt;
 			break;								// if y ou create your own background, do it here in and return (1) instead using &#039;break&#039;&lt;br /&gt;
 		case WM_PAINT:&lt;br /&gt;
 			{&lt;br /&gt;
 				PAINTSTRUCT ps;&lt;br /&gt;
 				HDC hdc;&lt;br /&gt;
 				wchar_t *WinOutput[] = {{L&amp;quot;Hello World!&amp;quot;},{L&amp;quot;This window was created  out of a DLL.&amp;quot;}};&lt;br /&gt;
 	 			hdc = BeginPaint(hwnd, &amp;amp;ps);   // now we have a valid device context to  modify the window&#039;s content&lt;br /&gt;
 				TextOut(hdc,20,20,WinOutput[0],wcslen(WinOutput[0]));&lt;br /&gt;
 				MoveToEx(hdc,20,40,NULL);&lt;br /&gt;
 				LineTo(hdc,120,40);&lt;br /&gt;
 				TextOut(hdc,20,60,WinOutput[1],wcslen(WinOutput[1]));&lt;br /&gt;
 				// do all drawing of your window  here in&lt;br /&gt;
 &lt;br /&gt;
 				EndPaint(hwnd,&amp;amp;ps);&lt;br /&gt;
 			}&lt;br /&gt;
 			break;&lt;br /&gt;
 		case WM_DESTROY:		// sent by the windows system just before the window will be destroyed&lt;br /&gt;
 								// disconnect from SimConnect out of this message&lt;br /&gt;
 			break;&lt;br /&gt;
 		case WM_CLOSE:&lt;br /&gt;
 			break;&lt;br /&gt;
 	}&lt;br /&gt;
 	return (DefWindowProcA(hwnd, message, wParam, lParam));&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enjoy!!&lt;br /&gt;
&lt;br /&gt;
[[category:Panel and Gauge Design]]&lt;/div&gt;</summary>
		<author><name>Narutokun-8877</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=FSX_Popup_windows&amp;diff=8726</id>
		<title>FSX Popup windows</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=FSX_Popup_windows&amp;diff=8726"/>
		<updated>2013-02-24T21:52:42Z</updated>

		<summary type="html">&lt;p&gt;Narutokun-8877: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox-Applicable-FSVersion&lt;br /&gt;
| FSXI = false&lt;br /&gt;
| FSXA = true&lt;br /&gt;
| FSX = false&lt;br /&gt;
| FS2004 = false&lt;br /&gt;
| FS2002 = false&lt;br /&gt;
| XP10 = false &lt;br /&gt;
| XP9 = false &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a short tutorial on how to create popup windows from a C++ gauge or SimConnect module dll. Do note that i will not be going into where to execute the creation functions from the gauge or SimConnect dll.&lt;br /&gt;
&lt;br /&gt;
First off, in your header file, add the following declarations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;windows.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;process.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 bool CreateWin();&lt;br /&gt;
 bool ExitWin();&lt;br /&gt;
 DWORD WINAPI WinThread(LPVOID lpParam);&lt;br /&gt;
 bool RegisterWin();&lt;br /&gt;
 LRESULT CALLBACK WinQueue(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);&lt;br /&gt;
 //Replace Win with any identifier name you want&lt;br /&gt;
&lt;br /&gt;
Then, in your cpp file, create the thread that the window message cue will be run from.&lt;br /&gt;
&lt;br /&gt;
 bool CreateWin()&lt;br /&gt;
 {&lt;br /&gt;
 	CreateThread(0, NULL, WinThread, NULL, NULL, NULL);&lt;br /&gt;
 	return true;&lt;br /&gt;
 //returns true so that you can know that you have sent the command to open the new window&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Also create a function to call to shut down the window(This window does come with a little red box in the upper right corner so this function is just an alternative(also can be called on shutdown)).&lt;br /&gt;
&lt;br /&gt;
 bool ExitWin()&lt;br /&gt;
 {&lt;br /&gt;
 	SendMessage(hwnd, WM_CLOSE, 0, 0);&lt;br /&gt;
 	return false;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Next is your function to register the class. Note that i have made it a template of the FS98FLOAT class to save some code lines.&lt;br /&gt;
&lt;br /&gt;
 bool RegisterWin()&lt;br /&gt;
 {&lt;br /&gt;
 	WNDCLASSW wc;	&lt;br /&gt;
 	memset(&amp;amp;wc,0,sizeof(WNDCLASS));&lt;br /&gt;
 	if(GetClassInfo(NULL, L&amp;quot;FS98FLOAT&amp;quot;, &amp;amp;wc))&lt;br /&gt;
 	{&lt;br /&gt;
 		wc.lpszClassName = L&amp;quot;MYFLOAT&amp;quot;;//Choose your class name&lt;br /&gt;
 		wc.hInstance = GetModuleHandle(L&amp;quot;MY_DLL.dll&amp;quot;);//place your dll name here&lt;br /&gt;
 		wc.lpfnWndProc = (WNDPROC) WinQueue;//Your message que function&lt;br /&gt;
 		wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);&lt;br /&gt;
 		if(RegisterClass(&amp;amp;wc))&lt;br /&gt;
 			return true;&lt;br /&gt;
 		else&lt;br /&gt;
 			return false;&lt;br /&gt;
 	}&lt;br /&gt;
 	else&lt;br /&gt;
 		return false;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
And now your thread function&lt;br /&gt;
&lt;br /&gt;
 DWORD WINAPI ACMProc(LPVOID lpParam)&lt;br /&gt;
 {&lt;br /&gt;
 	MSG msg;&lt;br /&gt;
 	RegisterWin();//Register the class&lt;br /&gt;
 	hwnd = CreateWindowEx(&lt;br /&gt;
 				WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR |  WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE,//necessary styles etc&lt;br /&gt;
 				L&amp;quot;MYFLOAT&amp;quot;, // Your class name				 				L&amp;quot;My Window&amp;quot;,//Window caption&lt;br /&gt;
 				WS_CAPTION | WS_POPUP | WS_CLIPSIBLINGS | WS_SYSMENU |  WS_THICKFRAME,//necessary styles etc&lt;br /&gt;
 				0,0, 800,600,//Window position/Dimensions&lt;br /&gt;
 				FindWindow(L&amp;quot;FS98MAIN&amp;quot;, L&amp;quot;Microsoft Flight Simulator X&amp;quot;),//The Parent  window&lt;br /&gt;
 				NULL,&lt;br /&gt;
 				GetModuleHandle(L&amp;quot;My_DLL.dll&amp;quot;),&lt;br /&gt;
 				NULL );&lt;br /&gt;
 	ShowWindow (hwnd, SW_SHOWNORMAL);//Shows the window&lt;br /&gt;
 	while (GetMessage (&amp;amp;msg, NULL, 0, 0))&lt;br /&gt;
 	{&lt;br /&gt;
 		TranslateMessage(&amp;amp;msg);&lt;br /&gt;
 		DispatchMessage(&amp;amp;msg);&lt;br /&gt;
 	}&lt;br /&gt;
 	return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
And finally, the message cue. You can do pretty much whatever you want from here out&lt;br /&gt;
&lt;br /&gt;
 LRESULT CALLBACK ACMQueue(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)&lt;br /&gt;
 {&lt;br /&gt;
 	switch(message)&lt;br /&gt;
 	{&lt;br /&gt;
 		case WM_CREATE:							// sent by the  windows system just before the window will be displayed the first time&lt;br /&gt;
 &lt;br /&gt;
 			// here is the best location to prepare your window i.e. connecting to SimConnect&lt;br /&gt;
 &lt;br /&gt;
 			break;&lt;br /&gt;
 		case WM_ERASEBKGND:					    // sent by windows if t he entire window will be renewed.&lt;br /&gt;
 			break;								// if y ou create your own background, do it here in and return (1) instead using &#039;break&#039;&lt;br /&gt;
 		case WM_PAINT:&lt;br /&gt;
 			{&lt;br /&gt;
 				PAINTSTRUCT ps;&lt;br /&gt;
 				HDC hdc;&lt;br /&gt;
 				wchar_t *WinOutput[] = {{L&amp;quot;Hello World!&amp;quot;},{L&amp;quot;This window was created  out of a DLL.&amp;quot;}};&lt;br /&gt;
	 			hdc = BeginPaint(hwnd, &amp;amp;ps);   // now we have a valid device context to modify the window&#039;s content&lt;br /&gt;
 				TextOut(hdc,20,20,WinOutput[0],wcslen(WinOutput[0]));&lt;br /&gt;
 				MoveToEx(hdc,20,40,NULL);&lt;br /&gt;
 				LineTo(hdc,120,40);&lt;br /&gt;
 				TextOut(hdc,20,60,WinOutput[1],wcslen(WinOutput[1]));&lt;br /&gt;
 				// do all drawing of your window  here in&lt;br /&gt;
 &lt;br /&gt;
 				EndPaint(hwnd,&amp;amp;ps);&lt;br /&gt;
 			}&lt;br /&gt;
 			break;&lt;br /&gt;
 		case WM_DESTROY:		// sent by the windows system just before the window will be destroyed&lt;br /&gt;
 								// disconnect from SimConnect out of this message&lt;br /&gt;
 			break;&lt;br /&gt;
 		case WM_CLOSE:&lt;br /&gt;
 			break;&lt;br /&gt;
 	}&lt;br /&gt;
 	return (DefWindowProcA(hwnd, message, wParam, lParam));&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enjoy!!&lt;br /&gt;
&lt;br /&gt;
[[category:Panel and Gauge Design]]&lt;/div&gt;</summary>
		<author><name>Narutokun-8877</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=FSX_Popup_windows&amp;diff=8725</id>
		<title>FSX Popup windows</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=FSX_Popup_windows&amp;diff=8725"/>
		<updated>2013-02-24T21:49:04Z</updated>

		<summary type="html">&lt;p&gt;Narutokun-8877: New page: {{Infobox-Applicable-FSVersion | FSXI = false | FSXA = false | FSX = false | FS2004 = false | FS2002 = false | XP10 = false  | XP9 = false  }}   Here is a short tutorial on how to create p...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox-Applicable-FSVersion&lt;br /&gt;
| FSXI = false&lt;br /&gt;
| FSXA = false&lt;br /&gt;
| FSX = false&lt;br /&gt;
| FS2004 = false&lt;br /&gt;
| FS2002 = false&lt;br /&gt;
| XP10 = false &lt;br /&gt;
| XP9 = false &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a short tutorial on how to create popup windows from a C++ gauge or SimConnect module dll. Do note that i will not be going into where to execute the creation functions from the gauge or SimConnect dll.&lt;br /&gt;
&lt;br /&gt;
First off, in your header file, add the following declarations:&lt;br /&gt;
&lt;br /&gt;
[CODE]&lt;br /&gt;
#include &amp;lt;windows.h&amp;gt;&lt;br /&gt;
#include &amp;lt;process.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
bool CreateWin();&lt;br /&gt;
bool ExitWin();&lt;br /&gt;
DWORD WINAPI WinThread(LPVOID lpParam);&lt;br /&gt;
bool RegisterWin();&lt;br /&gt;
LRESULT CALLBACK WinQueue(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);&lt;br /&gt;
//Replace Win with any identifier name you want&lt;br /&gt;
[/CODE]&lt;br /&gt;
&lt;br /&gt;
Then, in your cpp file, create the thread that the window message cue will be run from.&lt;br /&gt;
&lt;br /&gt;
[CODE]&lt;br /&gt;
bool CreateWin()&lt;br /&gt;
{&lt;br /&gt;
	CreateThread(0, NULL, WinThread, NULL, NULL, NULL);&lt;br /&gt;
	return true;&lt;br /&gt;
//returns true so that you can know that you have sent the command to open the new window&lt;br /&gt;
}&lt;br /&gt;
[/CODE]&lt;br /&gt;
&lt;br /&gt;
Also create a function to call to shut down the window(This window does come with a little red box in the upper right corner so this function is just an alternative(also can be called on shutdown)).&lt;br /&gt;
&lt;br /&gt;
[CODE]&lt;br /&gt;
bool ExitWin()&lt;br /&gt;
{&lt;br /&gt;
	SendMessage(hwnd, WM_CLOSE, 0, 0);&lt;br /&gt;
	return false;&lt;br /&gt;
}&lt;br /&gt;
[/CODE]&lt;br /&gt;
&lt;br /&gt;
Next is your function to register the class. Note that i have made it a template of the FS98FLOAT class to save some code lines.&lt;br /&gt;
&lt;br /&gt;
[CODE]&lt;br /&gt;
bool RegisterWin()&lt;br /&gt;
{&lt;br /&gt;
	WNDCLASSW wc;	&lt;br /&gt;
	memset(&amp;amp;wc,0,sizeof(WNDCLASS));&lt;br /&gt;
	if(GetClassInfo(NULL, L&amp;quot;FS98FLOAT&amp;quot;, &amp;amp;wc))&lt;br /&gt;
	{&lt;br /&gt;
		wc.lpszClassName = L&amp;quot;MYFLOAT&amp;quot;;//Choose your class name&lt;br /&gt;
		wc.hInstance = GetModuleHandle(L&amp;quot;MY_DLL.dll&amp;quot;);//place your dll name here&lt;br /&gt;
		wc.lpfnWndProc = (WNDPROC) WinQueue;//Your message que function&lt;br /&gt;
		wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);&lt;br /&gt;
		if(RegisterClass(&amp;amp;wc))&lt;br /&gt;
			return true;&lt;br /&gt;
		else&lt;br /&gt;
			return false;&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
		return false;&lt;br /&gt;
}&lt;br /&gt;
[/CODE]&lt;br /&gt;
&lt;br /&gt;
And now your thread function&lt;br /&gt;
&lt;br /&gt;
[CODE]&lt;br /&gt;
DWORD WINAPI ACMProc(LPVOID lpParam)&lt;br /&gt;
{&lt;br /&gt;
	MSG msg;&lt;br /&gt;
	RegisterWin();//Register the class&lt;br /&gt;
	hwnd = CreateWindowEx(&lt;br /&gt;
				WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE,//necessary styles etc&lt;br /&gt;
				L&amp;quot;MYFLOAT&amp;quot;, // Your class name								L&amp;quot;My Window&amp;quot;,//Window caption&lt;br /&gt;
				WS_CAPTION | WS_POPUP | WS_CLIPSIBLINGS | WS_SYSMENU | WS_THICKFRAME,//necessary styles etc&lt;br /&gt;
				0,0, 800,600,//Window position/Dimensions&lt;br /&gt;
				FindWindow(L&amp;quot;FS98MAIN&amp;quot;, L&amp;quot;Microsoft Flight Simulator X&amp;quot;),//The Parent window&lt;br /&gt;
				NULL,&lt;br /&gt;
				GetModuleHandle(L&amp;quot;My_DLL.dll&amp;quot;),&lt;br /&gt;
				NULL );&lt;br /&gt;
	ShowWindow (hwnd, SW_SHOWNORMAL);//Shows the window&lt;br /&gt;
	while (GetMessage (&amp;amp;msg, NULL, 0, 0))&lt;br /&gt;
	{&lt;br /&gt;
		TranslateMessage(&amp;amp;msg);&lt;br /&gt;
		DispatchMessage(&amp;amp;msg);&lt;br /&gt;
	}&lt;br /&gt;
	return 1;&lt;br /&gt;
}&lt;br /&gt;
[/CODE]&lt;br /&gt;
&lt;br /&gt;
And finally, the message cue. You can do pretty much whatever you want from here out&lt;br /&gt;
&lt;br /&gt;
[CODE]&lt;br /&gt;
LRESULT CALLBACK ACMQueue(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)&lt;br /&gt;
{&lt;br /&gt;
	switch(message)&lt;br /&gt;
	{&lt;br /&gt;
		case WM_CREATE:							// sent by the windows system just before the window will be displayed the first time&lt;br /&gt;
&lt;br /&gt;
			// here is the best location to prepare your window i.e. connecting to SimConnect&lt;br /&gt;
&lt;br /&gt;
			break;&lt;br /&gt;
		case WM_ERASEBKGND:					    // sent by windows if the entire window will be renewed.&lt;br /&gt;
			break;								// if you create your own background, do it here in and return (1) instead using &#039;break&#039;&lt;br /&gt;
		case WM_PAINT:&lt;br /&gt;
			{&lt;br /&gt;
				PAINTSTRUCT ps;&lt;br /&gt;
				HDC hdc;&lt;br /&gt;
				wchar_t *WinOutput[] = {{L&amp;quot;Hello World!&amp;quot;},{L&amp;quot;This window was created out of a DLL.&amp;quot;}};&lt;br /&gt;
				hdc = BeginPaint(hwnd, &amp;amp;ps);   // now we have a valid device context to modify the window&#039;s content&lt;br /&gt;
				TextOut(hdc,20,20,WinOutput[0],wcslen(WinOutput[0]));&lt;br /&gt;
				MoveToEx(hdc,20,40,NULL);&lt;br /&gt;
				LineTo(hdc,120,40);&lt;br /&gt;
				TextOut(hdc,20,60,WinOutput[1],wcslen(WinOutput[1]));&lt;br /&gt;
				// do all drawing of your window  here in&lt;br /&gt;
&lt;br /&gt;
				EndPaint(hwnd,&amp;amp;ps);&lt;br /&gt;
			}&lt;br /&gt;
			break;&lt;br /&gt;
		case WM_DESTROY:		// sent by the windows system just before the window will be destroyed&lt;br /&gt;
								// disconnect from SimConnect out of this message&lt;br /&gt;
			break;&lt;br /&gt;
		case WM_CLOSE:&lt;br /&gt;
			Vd-&amp;gt;INIS-&amp;gt;AcmWin = false;&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
	return (DefWindowProcA(hwnd, message, wParam, lParam));&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
[/CODE]&lt;br /&gt;
&lt;br /&gt;
Enjoy!!&lt;br /&gt;
&lt;br /&gt;
[[category:Panel and Gauge Design]]&lt;/div&gt;</summary>
		<author><name>Narutokun-8877</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=C:_C%2B%2B_timers&amp;diff=8578</id>
		<title>C: C++ timers</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=C:_C%2B%2B_timers&amp;diff=8578"/>
		<updated>2012-10-11T17:06:11Z</updated>

		<summary type="html">&lt;p&gt;Narutokun-8877: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox-Applicable-FSVersion&lt;br /&gt;
| FSXI = true&lt;br /&gt;
| FSXA = true&lt;br /&gt;
| FSX = true&lt;br /&gt;
| FS2004 = true&lt;br /&gt;
| FS2002 = true&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Most of you may be familiar with the TICK18 token variable which is incremented at 18Hz. Another option to make use of the 18Hz increment system (like making 0.5 second timers and such) is to call a function from the PANEL_SERVICE_PRE_UPDATE case of your callback function which increments your timing variable which you simply reset to 0 when it is equal to 9 (for a 0.5 second timer). However there is another option that allows for timers that range from several minutes down to 1 millisecond. &lt;br /&gt;
&lt;br /&gt;
 #include windows.h&lt;br /&gt;
&lt;br /&gt;
 void CALLBACK My_Timer();&lt;br /&gt;
 UINT_PTR IDT_TIMER1;&lt;br /&gt;
&lt;br /&gt;
The above code creates the function prototype for the callback function which will be executed at the desired interval. It also creates the timer ID variable.&lt;br /&gt;
&lt;br /&gt;
To create the timer in your gauge callback function:&lt;br /&gt;
&lt;br /&gt;
 case PANEL_SERVICE_PRE_INITIALIZE:&lt;br /&gt;
 SetTimer(NULL, IDT_TIMER1, 1000, (TIMERPROC)My_Timer);&lt;br /&gt;
 //1st parameter is optional and not required in this&lt;br /&gt;
 //case, second parameter is timer ID, third parameter is timer interval in milliseconds, 4th parameter is callback&lt;br /&gt;
 //function&lt;br /&gt;
 break;&lt;br /&gt;
&lt;br /&gt;
Once you are finished with the timer, remove it as shown below:&lt;br /&gt;
&lt;br /&gt;
 case PANEL_SERVICE_DISCONNECT:&lt;br /&gt;
 KillTimer(NULL, IDT_TIMER1);&lt;br /&gt;
 break;&lt;br /&gt;
&lt;br /&gt;
To increment your timer variable:&lt;br /&gt;
&lt;br /&gt;
 int timer_1sec = 0;&lt;br /&gt;
 void CALLBACK My_Timer()&lt;br /&gt;
 {&lt;br /&gt;
 timer ++;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft Design]]&lt;br /&gt;
[[Category:Panel and Gauge Design]]&lt;/div&gt;</summary>
		<author><name>Narutokun-8877</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=C:_C%2B%2B_timers&amp;diff=8577</id>
		<title>C: C++ timers</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=C:_C%2B%2B_timers&amp;diff=8577"/>
		<updated>2012-10-11T17:03:45Z</updated>

		<summary type="html">&lt;p&gt;Narutokun-8877: New page: {{Infobox-Applicable-FSVersion | FSXI = false | FSXA = false | FSX = false | FS2004 = false | FS2002 = false | XP10 = false  | XP9 = false  }}   Most of you may be familiar with the TICK18...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox-Applicable-FSVersion&lt;br /&gt;
| FSXI = false&lt;br /&gt;
| FSXA = false&lt;br /&gt;
| FSX = false&lt;br /&gt;
| FS2004 = false&lt;br /&gt;
| FS2002 = false&lt;br /&gt;
| XP10 = false &lt;br /&gt;
| XP9 = false &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Most of you may be familiar with the TICK18 token variable which is incremented at 18Hz. Another option to make use of the 18Hz increment system (like making 0.5 second timers and such) is to call a function from the PANEL_SERVICE_PRE_UPDATE case of your callback function which increments your timing variable which you simply reset to 0 when it is equal to 9 (for a 0.5 second timer). However there is another option that allows for timers that range from several minutes down to 1 millisecond. &lt;br /&gt;
&lt;br /&gt;
 #include windows.h&lt;br /&gt;
&lt;br /&gt;
 void CALLBACK My_Timer();&lt;br /&gt;
 UINT_PTR IDT_TIMER1;&lt;br /&gt;
&lt;br /&gt;
The above code creates the function prototype for the callback function which will be executed at the desired interval. It also creates the timer ID variable.&lt;br /&gt;
&lt;br /&gt;
To create the timer in your gauge callback function:&lt;br /&gt;
&lt;br /&gt;
 case PANEL_SERVICE_PRE_INITIALIZE:&lt;br /&gt;
 SetTimer(NULL, IDT_TIMER1, 1000, (TIMERPROC)My_Timer);&lt;br /&gt;
 //1st parameter is optional and not required in this&lt;br /&gt;
 //case, second parameter is timer ID, third parameter is timer interval in milliseconds, 4th parameter is callback&lt;br /&gt;
 //function&lt;br /&gt;
 break;&lt;br /&gt;
&lt;br /&gt;
Once you are finished with the timer, remove it as shown below:&lt;br /&gt;
&lt;br /&gt;
 case PANEL_SERVICE_DISCONNECT:&lt;br /&gt;
 KillTimer(NULL, IDT_TIMER1);&lt;br /&gt;
 break;&lt;br /&gt;
&lt;br /&gt;
To increment your timer variable:&lt;br /&gt;
&lt;br /&gt;
 int timer_1sec = 0;&lt;br /&gt;
 void CALLBACK My_Timer()&lt;br /&gt;
 {&lt;br /&gt;
 timer ++;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft Design]]&lt;br /&gt;
[[Category:Panel and Gauge Design]]&lt;/div&gt;</summary>
		<author><name>Narutokun-8877</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=C:_Decimal_to_BCD&amp;diff=8576</id>
		<title>C: Decimal to BCD</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=C:_Decimal_to_BCD&amp;diff=8576"/>
		<updated>2012-10-11T16:48:22Z</updated>

		<summary type="html">&lt;p&gt;Narutokun-8877: /* C: BCD to Decimal and Decimal to BCD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox-Applicable-FSVersion&lt;br /&gt;
| FSXI = false&lt;br /&gt;
| FSXA = true&lt;br /&gt;
| FSX = true&lt;br /&gt;
| FS2004 = true&lt;br /&gt;
| FS2002 = true&lt;br /&gt;
| FS2000 = true&lt;br /&gt;
| FS98 = true&lt;br /&gt;
}}&lt;br /&gt;
== C: BCD to Decimal and Decimal to BCD ==&lt;br /&gt;
&lt;br /&gt;
This scheme was supplied by Arne Bartels which allows BCD conversion in both directions. Add the following to the master source file:-&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;math.h&amp;gt;&lt;br /&gt;
 #define Bcd2Dec(BcdNum) HornerScheme(BcdNum,0x10,10)&lt;br /&gt;
 #define Dec2Bcd(DecNum) HornerScheme(DecNum,10,0x10)&lt;br /&gt;
 &lt;br /&gt;
 UINT32 HornerScheme(UINT32 Num,UINT32 Divider,UINT32 Factor)&lt;br /&gt;
 {&lt;br /&gt;
    UINT32 Remainder=0,Quotient=0,Result=0;&lt;br /&gt;
    Remainder=Num%Divider;&lt;br /&gt;
    Quotient=Num/Divider;&lt;br /&gt;
    if(!(Quotient==0&amp;amp;&amp;amp;Remainder==0))&lt;br /&gt;
    Result+=HornerScheme(Quotient,Divider,Factor)*Factor+Remainder;&lt;br /&gt;
    return Result;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Then for each sub-gauge that requires a BCD conversion use the following syntax:-&lt;br /&gt;
&lt;br /&gt;
 Bcd2Dec(bcd_number) for BCD to decimal and&lt;br /&gt;
 Dec2Bcd(dec_number) for decimal to BCD conversions.&lt;br /&gt;
&lt;br /&gt;
In order to send frequencies to the ADF radios, multiply the desired frequency by 10000:&lt;br /&gt;
&lt;br /&gt;
 float adf_freq = 0;&lt;br /&gt;
 adf_freq = 286.5;&lt;br /&gt;
 trigger_key_event(KEY_ADF_COMPLETE_SET, Dec2Bcd(adf_freq*10000));&lt;br /&gt;
&lt;br /&gt;
In order to send frequencies to the COM radios, multiply the desired frequency by 100:&lt;br /&gt;
&lt;br /&gt;
 float com_freq = 0;&lt;br /&gt;
 com_freq = 122.875;&lt;br /&gt;
 trigger_key_event(KEY_COM_RADIO_SET, Dec2Bcd(com_freq * 100));&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft Design]]&lt;br /&gt;
[[Category:Panel and Gauge Design]]&lt;/div&gt;</summary>
		<author><name>Narutokun-8877</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=C:_Decimal_to_BCD&amp;diff=8575</id>
		<title>C: Decimal to BCD</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=C:_Decimal_to_BCD&amp;diff=8575"/>
		<updated>2012-10-11T16:46:22Z</updated>

		<summary type="html">&lt;p&gt;Narutokun-8877: /* C: BCD to Decimal and Decimal to BCD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox-Applicable-FSVersion&lt;br /&gt;
| FSXI = false&lt;br /&gt;
| FSXA = true&lt;br /&gt;
| FSX = true&lt;br /&gt;
| FS2004 = true&lt;br /&gt;
| FS2002 = true&lt;br /&gt;
| FS2000 = true&lt;br /&gt;
| FS98 = true&lt;br /&gt;
}}&lt;br /&gt;
== C: BCD to Decimal and Decimal to BCD ==&lt;br /&gt;
&lt;br /&gt;
This scheme was supplied by Arne Bartels which allows BCD conversion in both directions. Add the following to the master source file:-&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;math.h&amp;gt;&lt;br /&gt;
 #define Bcd2Dec(BcdNum) HornerScheme(BcdNum,0x10,10)&lt;br /&gt;
 #define Dec2Bcd(DecNum) HornerScheme(DecNum,10,0x10)&lt;br /&gt;
 &lt;br /&gt;
 UINT32 HornerScheme(UINT32 Num,UINT32 Divider,UINT32 Factor)&lt;br /&gt;
 {&lt;br /&gt;
    UINT32 Remainder=0,Quotient=0,Result=0;&lt;br /&gt;
    Remainder=Num%Divider;&lt;br /&gt;
    Quotient=Num/Divider;&lt;br /&gt;
    if(!(Quotient==0&amp;amp;&amp;amp;Remainder==0))&lt;br /&gt;
    Result+=HornerScheme(Quotient,Divider,Factor)*Factor+Remainder;&lt;br /&gt;
    return Result;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Then for each sub-gauge that requires a BCD conversion use the following syntax:-&lt;br /&gt;
&lt;br /&gt;
 Bcd2Dec(bcd_number) for BCD to decimal and&lt;br /&gt;
 Dec2Bcd(dec_number) for decimal to BCD conversions.&lt;br /&gt;
&lt;br /&gt;
In order to send frequencies to the ADF radios, multiply the desired frequency by 10000:&lt;br /&gt;
&lt;br /&gt;
float adf_freq = 0;&lt;br /&gt;
adf_freq = 286.5;&lt;br /&gt;
trigger_key_event(KEY_ADF_COMPLETE_SET, Dec2Bcd(adf_freq*10000));&lt;br /&gt;
&lt;br /&gt;
In order to send frequencies to the COM radios, multiply the desired frequency by 100:&lt;br /&gt;
&lt;br /&gt;
float com_freq = 0;&lt;br /&gt;
com_freq = 122.875;&lt;br /&gt;
trigger_key_event(KEY_COM_RADIO_SET, Dec2Bcd(com_freq * 100));&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft Design]]&lt;br /&gt;
[[Category:Panel and Gauge Design]]&lt;/div&gt;</summary>
		<author><name>Narutokun-8877</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=C:_Decimal_to_BCD&amp;diff=8574</id>
		<title>C: Decimal to BCD</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=C:_Decimal_to_BCD&amp;diff=8574"/>
		<updated>2012-10-11T16:46:01Z</updated>

		<summary type="html">&lt;p&gt;Narutokun-8877: /* C: BCD to Decimal and Decimal to BCD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox-Applicable-FSVersion&lt;br /&gt;
| FSXI = false&lt;br /&gt;
| FSXA = true&lt;br /&gt;
| FSX = true&lt;br /&gt;
| FS2004 = true&lt;br /&gt;
| FS2002 = true&lt;br /&gt;
| FS2000 = true&lt;br /&gt;
| FS98 = true&lt;br /&gt;
}}&lt;br /&gt;
== C: BCD to Decimal and Decimal to BCD ==&lt;br /&gt;
&lt;br /&gt;
This scheme was supplied by Arne Bartels which allows BCD conversion in both directions. Add the following to the master source file:-&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;math.h&amp;gt;&lt;br /&gt;
 #define Bcd2Dec(BcdNum) HornerScheme(BcdNum,0x10,10)&lt;br /&gt;
 #define Dec2Bcd(DecNum) HornerScheme(DecNum,10,0x10)&lt;br /&gt;
 &lt;br /&gt;
 UINT32 HornerScheme(UINT32 Num,UINT32 Divider,UINT32 Factor)&lt;br /&gt;
 {&lt;br /&gt;
    UINT32 Remainder=0,Quotient=0,Result=0;&lt;br /&gt;
    Remainder=Num%Divider;&lt;br /&gt;
    Quotient=Num/Divider;&lt;br /&gt;
    if(!(Quotient==0&amp;amp;&amp;amp;Remainder==0))&lt;br /&gt;
    Result+=HornerScheme(Quotient,Divider,Factor)*Factor+Remainder;&lt;br /&gt;
    return Result;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Then for each sub-gauge that requires a BCD conversion use the following syntax:-&lt;br /&gt;
&lt;br /&gt;
 Bcd2Dec(bcd_number) for BCD to decimal and&lt;br /&gt;
 Dec2Bcd(dec_number) for decimal to BCD conversions.&lt;br /&gt;
&lt;br /&gt;
In order to send frequencies to the ADF radios, multiply the desired frequency by 10000:&lt;br /&gt;
&lt;br /&gt;
[code]&lt;br /&gt;
float adf_freq = 0;&lt;br /&gt;
adf_freq = 286.5;&lt;br /&gt;
trigger_key_event(KEY_ADF_COMPLETE_SET, Dec2Bcd(adf_freq*10000));&lt;br /&gt;
[\code]&lt;br /&gt;
&lt;br /&gt;
In order to send frequencies to the COM radios, multiply the desired frequency by 100:&lt;br /&gt;
&lt;br /&gt;
float com_freq = 0;&lt;br /&gt;
com_freq = 122.875;&lt;br /&gt;
trigger_key_event(KEY_COM_RADIO_SET, Dec2Bcd(com_freq * 100));&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft Design]]&lt;br /&gt;
[[Category:Panel and Gauge Design]]&lt;/div&gt;</summary>
		<author><name>Narutokun-8877</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=C:_Decimal_to_BCD&amp;diff=8573</id>
		<title>C: Decimal to BCD</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=C:_Decimal_to_BCD&amp;diff=8573"/>
		<updated>2012-10-11T16:45:43Z</updated>

		<summary type="html">&lt;p&gt;Narutokun-8877: /* C: BCD to Decimal and Decimal to BCD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox-Applicable-FSVersion&lt;br /&gt;
| FSXI = false&lt;br /&gt;
| FSXA = true&lt;br /&gt;
| FSX = true&lt;br /&gt;
| FS2004 = true&lt;br /&gt;
| FS2002 = true&lt;br /&gt;
| FS2000 = true&lt;br /&gt;
| FS98 = true&lt;br /&gt;
}}&lt;br /&gt;
== C: BCD to Decimal and Decimal to BCD ==&lt;br /&gt;
&lt;br /&gt;
This scheme was supplied by Arne Bartels which allows BCD conversion in both directions. Add the following to the master source file:-&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;math.h&amp;gt;&lt;br /&gt;
 #define Bcd2Dec(BcdNum) HornerScheme(BcdNum,0x10,10)&lt;br /&gt;
 #define Dec2Bcd(DecNum) HornerScheme(DecNum,10,0x10)&lt;br /&gt;
 &lt;br /&gt;
 UINT32 HornerScheme(UINT32 Num,UINT32 Divider,UINT32 Factor)&lt;br /&gt;
 {&lt;br /&gt;
    UINT32 Remainder=0,Quotient=0,Result=0;&lt;br /&gt;
    Remainder=Num%Divider;&lt;br /&gt;
    Quotient=Num/Divider;&lt;br /&gt;
    if(!(Quotient==0&amp;amp;&amp;amp;Remainder==0))&lt;br /&gt;
    Result+=HornerScheme(Quotient,Divider,Factor)*Factor+Remainder;&lt;br /&gt;
    return Result;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Then for each sub-gauge that requires a BCD conversion use the following syntax:-&lt;br /&gt;
&lt;br /&gt;
 Bcd2Dec(bcd_number) for BCD to decimal and&lt;br /&gt;
 Dec2Bcd(dec_number) for decimal to BCD conversions.&lt;br /&gt;
&lt;br /&gt;
In order to send frequencies to the ADF radios, multiply the desired frequency by 10000:&lt;br /&gt;
&lt;br /&gt;
[code]&lt;br /&gt;
float adf_freq = 0;&lt;br /&gt;
adf_freq = 286.5;&lt;br /&gt;
trigger_key_event(KEY_ADF_COMPLETE_SET, Dec2Bcd(adf_freq*10000));&lt;br /&gt;
[/code]&lt;br /&gt;
&lt;br /&gt;
In order to send frequencies to the COM radios, multiply the desired frequency by 100:&lt;br /&gt;
&lt;br /&gt;
float com_freq = 0;&lt;br /&gt;
com_freq = 122.875;&lt;br /&gt;
trigger_key_event(KEY_COM_RADIO_SET, Dec2Bcd(com_freq * 100));&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft Design]]&lt;br /&gt;
[[Category:Panel and Gauge Design]]&lt;/div&gt;</summary>
		<author><name>Narutokun-8877</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=C:_Decimal_to_BCD&amp;diff=8572</id>
		<title>C: Decimal to BCD</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=C:_Decimal_to_BCD&amp;diff=8572"/>
		<updated>2012-10-11T16:44:18Z</updated>

		<summary type="html">&lt;p&gt;Narutokun-8877: /* C: BCD to Decimal and Decimal to BCD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox-Applicable-FSVersion&lt;br /&gt;
| FSXI = false&lt;br /&gt;
| FSXA = true&lt;br /&gt;
| FSX = true&lt;br /&gt;
| FS2004 = true&lt;br /&gt;
| FS2002 = true&lt;br /&gt;
| FS2000 = true&lt;br /&gt;
| FS98 = true&lt;br /&gt;
}}&lt;br /&gt;
== C: BCD to Decimal and Decimal to BCD ==&lt;br /&gt;
&lt;br /&gt;
This scheme was supplied by Arne Bartels which allows BCD conversion in both directions. Add the following to the master source file:-&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;math.h&amp;gt;&lt;br /&gt;
 #define Bcd2Dec(BcdNum) HornerScheme(BcdNum,0x10,10)&lt;br /&gt;
 #define Dec2Bcd(DecNum) HornerScheme(DecNum,10,0x10)&lt;br /&gt;
 &lt;br /&gt;
 UINT32 HornerScheme(UINT32 Num,UINT32 Divider,UINT32 Factor)&lt;br /&gt;
 {&lt;br /&gt;
    UINT32 Remainder=0,Quotient=0,Result=0;&lt;br /&gt;
    Remainder=Num%Divider;&lt;br /&gt;
    Quotient=Num/Divider;&lt;br /&gt;
    if(!(Quotient==0&amp;amp;&amp;amp;Remainder==0))&lt;br /&gt;
    Result+=HornerScheme(Quotient,Divider,Factor)*Factor+Remainder;&lt;br /&gt;
    return Result;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Then for each sub-gauge that requires a BCD conversion use the following syntax:-&lt;br /&gt;
&lt;br /&gt;
 Bcd2Dec(bcd_number) for BCD to decimal and&lt;br /&gt;
 Dec2Bcd(dec_number) for decimal to BCD conversions.&lt;br /&gt;
&lt;br /&gt;
In order to send frequencies to the ADF radios, multiply the desired frequency by 10000:&lt;br /&gt;
&lt;br /&gt;
float adf_freq = 0;&lt;br /&gt;
adf_freq = 286.5;&lt;br /&gt;
trigger_key_event(KEY_ADF_COMPLETE_SET, Dec2Bcd(adf_freq*10000));&lt;br /&gt;
&lt;br /&gt;
In order to send frequencies to the COM radios, multiply the desired frequency by 100:&lt;br /&gt;
&lt;br /&gt;
float com_freq = 0;&lt;br /&gt;
com_freq = 122.875;&lt;br /&gt;
trigger_key_event(KEY_COM_RADIO_SET, Dec2Bcd(com_freq * 100));&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft Design]]&lt;br /&gt;
[[Category:Panel and Gauge Design]]&lt;/div&gt;</summary>
		<author><name>Narutokun-8877</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=XML:_Ferris_Wheel_Effect&amp;diff=8278</id>
		<title>XML: Ferris Wheel Effect</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=XML:_Ferris_Wheel_Effect&amp;diff=8278"/>
		<updated>2011-12-09T15:15:30Z</updated>

		<summary type="html">&lt;p&gt;Narutokun-8877: /* XML: Ferris Wheel Effect */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==XML: Ferris Wheel Effect==&lt;br /&gt;
&lt;br /&gt;
Most commonly used for labels on compass roses.  This effect will keep the label upright, while the compass rotates.&lt;br /&gt;
&lt;br /&gt;
Create your label and position it at 0 degrees, then assign 2 shifts to it. One for the X and one for the Y.&lt;br /&gt;
&lt;br /&gt;
The Y shift script is:&lt;br /&gt;
&lt;br /&gt;
-Radius * cos(heading - compass point)&lt;br /&gt;
&lt;br /&gt;
The X shift is:&lt;br /&gt;
&lt;br /&gt;
-Radius * sin(heading - compass point)&lt;br /&gt;
&lt;br /&gt;
Note that this technique can also be used in GDI+/DirectX displays.&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft Design]]&lt;br /&gt;
[[Category:Panel and Gauge Design]]&lt;/div&gt;</summary>
		<author><name>Narutokun-8877</name></author>
	</entry>
</feed>