Tuesday, July 20, 2010

Dialog box for further study



We will further study this course in the dialog box. In particular, we will explore how the dialog box as the input device. If you learn a lesson, it will find an example of this lesson is only a small amount of change, that is, the dialog window of our subsidiary to the main window. In addition, we also study the use of common dialog boxes.

Theory:

The dialog box as an input device to use is really very simple, you create the main window, you just call the function CreatedialogParam or DialogBoxParam on it, before a function so long as the process in the dialog box handler can handle the message , which you must insert a paragraph in the message loop function IsDialogMessage call it logic to handle the keyboard keys. Because these two are relatively easy to program segment, we would not Xiangjie. You can download and study carefully.

Here we discuss the common dialog box. WINDOWS have been ready for your pre-defined dialog box class, you can put on the use of these common dialog boxes available to users with a unified interface. They include: open the file, print, choose colors, fonts, and searching. You should try to use them. To deal with these dialog code comdlg32.dll, in order to in your application to use them, you must link library files in the link stage comdlg32.lib. Then you can call one of the correlation function. Open File common dialog box for the function called GetOpenFileName, "Save as ..." dialog box for the GetSaveFileName, print common dialog box is PrintDlg, etc.. Each of these functions takes a pointer to point to a structure parameter, you can refer to the WIN32 API manual for detailed information, this lesson I will explain the creation and use of open file dialog box.
Here is the prototype of the Open dialog box function GetOpenFileName:

GetOpenFileName proto lpofn: DWORD
You can see that the function has only one parameter, that is, a pointer pointing to OPENFILENAME structure. When the user selects a file and open, the function returns TRUE, otherwise returns FALSE. Next we look at the definition of structure OPENFILENAME:

OPENFILENAME STRUCT
lStructSize DWORD?
hwndOwner HWND?
hInstance HINSTANCE?
lpstrFilter LPCSTR?
lpstrCustomFilter LPSTR?
nMaxCustFilter DWORD?
nFilterIndex DWORD?
lpstrFile LPSTR?
nMaxFile DWORD?
lpstrFileTitle LPSTR?
nMaxFileTitle DWORD?
lpstrInitialDir LPCSTR?
lpstrTitle LPCSTR?
Flags DWORD?
nFileOffset WORD?
nFileExtension WORD?
lpstrDefExt LPCSTR?
lCustData LPARAM?
lpfnHook DWORD?
lpTemplateName LPCSTR?
OPENFILENAME ENDS
Well, let us look at the structure in the common meaning of members:

lStructSize structure OPENFILENAME size.
hwndOwner Open dialog box has a handle of the window.
hInstance has the file open dialog application instance handle.
lpstrFilter to NULL at the end of one or more wildcard. Wildcards are in pairs, the first part of description, the last part is the wildcard format, such as:
FilterString db "All Files (*.*)", 0, "*.*", 0
db "Text Files (*. txt)", 0, "*. txt", 0,0
Note: Only the second part of each pair is required to filter WINDOWS selected files, and the other after the part you must place a 0 to indicate the end of the string.

nFilterIndex open file dialog box to specify when the first open string with the filter, the index is counted from a beginning, that is a wildcard pattern of the index is 1, the second is 2, for example, the example above If specified the value of 2, then the default display mode is string "*. txt".
lpstrFile need to open the file name of the address, the name will appear in the Open File dialog box, edit control, the buffer can not exceed 260 characters long, when the user opens the file, the buffer contains all the files path name, you can extract from the buffer you need a path or file name and other information.
nMaxFile lpstrFile size.
lpstrTitle point dialog title string.
Flags mark the decision of the dialog box determines the style and features.
nFileOffset the user opens a file, the value is the full path name of the file name points to the index of first character. For example: If the full path name "c: windowssystemlz32.dll", then the value is 18.
nFileExtension the user opens a file, the value is the full path name pointing to a file extension of the first character of the index.


Examples:
The following example, we have demonstrated that when the user selects "File-> Open", it will pop up a dialog box to open the file, when the user selects a file to open, it will pop up a dialog box, told to open the file full path name, file name and file extension.
.386
. Model flat, stdcall
option casemap: none
WinMain proto: DWORD,: DWORD,: DWORD,: DWORD
include masm32includewindows.inc
include masm32includeuser32.inc
include masm32includekernel32.inc
include masm32includecomdlg32.inc
includelib masm32libuser32.lib
includelib masm32libkernel32.lib
includelib masm32libcomdlg32.lib

. Const
IDM_OPEN equ 1
IDM_EX99v equ 2
MAXSIZE equ 260
OUTPUTSIZE equ 512

. Data
ClassName db "SimpleWinClass", 0
AppName db "Our Main Window", 0
MenuName db "FirstMenu", 0
ofn OPENFILENAME <>
FilterString db "All Files", 0 ,"*.*", 0
db "Text Files", 0, "*. txt", 0,0
buffer db MAXSIZE dup (0)
OurTitle db "-= Our First Open File Dialog Box =-: Choose the file to open", 0
FullPathName db "The Full Filename with Path is:", 0
FullName db "The Filename is:", 0
ExtensionName db "The Extension is:", 0
OutputString db OUTPUTSIZE dup (0)
CrLf db 0Dh, 0Ah, 0

. Data?
hInstance HINSTANCE?
CommandLine LPSTR?

. Code
start:
invoke GetModuleHandle, NULL
mov hInstance, eax
invoke GetCommandLine
mov CommandLine, eax
invoke WinMain, hInstance, NULL, CommandLine, SW_SHOWDEFAULT
invoke ExitProcess, eax

WinMain proc hInst: HINSTANCE, hPrevInst: HINSTANCE, CmdLine: LPSTR, CmdShow: DWORD
LOCAL wc: WNDCLASSEX
LOCAL msg: MSG
LOCAL hwnd: HWND
mov wc.cbSize, SIZEOF WNDCLASSEX
mov wc.style, CS_HREDRAW or CS_VREDRAW
mov wc.lpfnWndProc, OFFSET WndProc
mov wc.cbClsExtra, NULL
mov wc.cbWndExtra, NULL
push hInst
pop wc.hInstance
mov wc.hbrBackground, COLOR_WINDOW +1
mov wc.lpszMenuName, OFFSET MenuName
mov wc.lpszClassName, OFFSET ClassName
invoke LoadIcon, NULL, IDI_APPLICATION
mov wc.hIcon, eax
mov wc.hIconSm, eax
invoke LoadCursor, NULL, IDC_ARROW
mov wc.hCursor, eax
invoke RegisterClassEx, addr wc
invoke CreateWindowEx, WS_EX_CLIENTEDGE, ADDR ClassName, ADDR AppName,
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
CW_USEDEFAULT, 300,200, NULL, NULL,
hInst, NULL
mov hwnd, eax
invoke ShowWindow, hwnd, SW_SHOWNORMAL
invoke UpdateWindow, hwnd
. WHILE TRUE
invoke GetMessage, ADDR msg, NULL, 0,0
. BREAK. IF (! Eax)
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
. ENDW
mov eax, msg.wParam
ret
WinMain endp

WndProc proc hWnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: LPARAM
. IF uMsg == WM_DESTROY
invoke PostQuitMessage, NULL
. ELSEIF uMsg == WM_COMMAND
mov eax, wParam
. If ax == IDM_OPEN
mov ofn.lStructSize, SIZEOF ofn
push hWnd
pop ofn.hwndOwner
push hInstance
pop ofn.hInstance
mov ofn.lpstrFilter, OFFSET FilterString
mov ofn.lpstrFile, OFFSET buffer
mov ofn.nMaxFile, MAXSIZE
mov ofn.Flags, OFN_FILEMUSTEXIST or
OFN_PATHMUSTEXIST or OFN_LONGNAMES or
OFN_EXPLORER or OFN_HIDEREADONLY
mov ofn.lpstrTitle, OFFSET OurTitle
invoke GetOpenFileName, ADDR ofn
. If eax == TRUE
invoke lstrcat, offset OutputString, OFFSET FullPathName
invoke lstrcat, offset OutputString, ofn.lpstrFile
invoke lstrcat, offset OutputString, offset CrLf
invoke lstrcat, offset OutputString, offset FullName
mov eax, ofn.lpstrFile
push ebx
xor ebx, ebx
mov bx, ofn.nFileOffset
add eax, ebx
pop ebx
invoke lstrcat, offset OutputString, eax
invoke lstrcat, offset OutputString, offset CrLf
invoke lstrcat, offset OutputString, offset ExtensionName
mov eax, ofn.lpstrFile
push ebx
xor ebx, ebx
mov bx, ofn.nFileExtension
add eax, ebx
pop ebx
invoke lstrcat, offset OutputString, eax
invoke MessageBox, hWnd, OFFSET OutputString, ADDR AppName, MB_OK
invoke RtlZeroMemory, offset OutputString, OUTPUTSIZE
. Endif
. Else
invoke DestroyWindow, hWnd
. Endif
. ELSE
invoke DefWindowProc, hWnd, uMsg, wParam, lParam
ret
. ENDIF
xor eax, eax
ret
WndProc endp
end start


-------------------------------------------------- ------------------------------

Analysis:
mov ofn.lStructSize, SIZEOF ofn
push hWnd
pop ofn.hwndOwner
push hInstance
pop ofn.hInstance
We are here to fill structure of the members of the OPENFILENAME ofn variables.

mov ofn.lpstrFilter, OFFSET FilterString

Here FilterString the file filter string address, we specify the filter string is as follows:

FilterString db "All Files", 0 ,"*.*", 0
db "Text Files", 0, "*. txt", 0,0
Note: All model series are paired, one a description of the latter is the real model, sub-office "*.*" and "*. txt" is used to find matching WIONDOWS want to open documents. When can we can specify any mode, but do not forget to add 0 to represent the end of the string has ended, or your operation may be unstable in the dialog box.
mov ofn.lpstrFile, OFFSET buffer
mov ofn.nMaxFile, MAXSIZE

Here is the address of the buffer into the structure, the size must be set. Since we are free to edit the information returned in the buffer.

mov ofn.Flags, OFN_FILEMUSTEXIST or
OFN_PATHMUSTEXIST or OFN_LONGNAMES or
OFN_EXPLORER or OFN_HIDEREADONLY

Flags in the dialog box into the style and property value.
One OFN_FILEMUSTEXIST and OFN_PATHMUSTEXIST require the user to the edit control in the Open dialog box, enter the file name or path name must exist.
OFN_LONGNAMES tell the dialog box display long file names.
OFN_EXPLORER told WINDOWS dialog must look like Explorer.
OFN_HIDEREADONLY designated read-only files do not show (even if it is the extension of the filter mode).
In addition, there are many other flags, you can refer to the WIN32 API manual.

mov ofn.lpstrTitle, OFFSET OurTitle

Open File dialog box specify the title name.

invoke GetOpenFileName, ADDR ofn

GetOpenFileName function call, and pass a pointer to point to structure ofn.
At this time, open the file dialog box that come, GetOpenFileName function to wait until after the user selects a file will be returned, or when the user presses the CANCEL button or close the dialog box.
When the user selects to open a file, the function returns TRUE, otherwise returns FALSE.

. If eax == TRUE
invoke lstrcat, offset OutputString, OFFSET FullPathName
invoke lstrcat, offset OutputString, ofn.lpstrFile
invoke lstrcat, offset OutputString, offset CrLf
invoke lstrcat, offset OutputString, offset FullName

When the user selects to open a file, we will display a dialog box in a string, we first give OutputString variables to allocate memory, then call the PAI function lstrcat, with all the strings together, in order for these strings branches shows that we must add a line break the back of each string.

mov eax, ofn.lpstrFile
push ebx
xor ebx, ebx
mov bx, ofn.nFileOffset
add eax, ebx
pop ebx
invoke lstrcat, offset OutputString, eax

Above these lines may require some explanation. nFileOffset value equal to the full path name to open the file in the file name's first character in the index, as nFileOffset is a WORD type variable, and lpstrFile is a DWORD pointer shape, so we will have to deposit a conversion to nFileOffset the bottom byte ebx register, and then add to the eax register to get a pointer type DWORD.

invoke MessageBox, hWnd, OFFSET OutputString, ADDR AppName, MB_OK

We are in the dialog box display the string.

invoke RtlZerolMemory, offset OutputString, OUTPUTSIZE

In order to correctly display the next time, we must clear the buffer, we call the function RtlZerolMemory to do it.







Recommended links:



Online TV Toolbar



YOUTUBE Video to DAT Home



Youtube FLV to 3G2 Products



convert .flac to mp3



Good Audio CD Players



Premier Recreation



News about Web Or Video Cams



Catalogs Icon Tools



Swf file



Bluesea SWF Flash Converter



Youtube Movie to Treo Application



f4v Converter



Mkv file?



AlltoDVD PDA Converter



WMA to MP3 CONVERTER



Friday, July 9, 2010

WorldCup DVD to Flash


WorldCup DVD to Flash is a All-in-One powerful tool. Convert all popular video and audio formats, swf or flv to video, such as avi, mpeg, 3gp, mp4, mov, it offers the solutions to problems that many other flash to video converting tools cannot solve, such as video and audio asynchronization, loss of frames, audio distortion, the process of alpha channel, and the process of both internal and external Flash video(flv). With the leading audio and video codec, DVD to Flash lets you easily and fully enjoy the original effects of your Flash files on your PC, iPod, PSP, Zune, iPhone, DVD players and other portable devices. In conclusion, with easy-to-use interface, fast converting speed, powerful functions.



Recommand Link:



CD Start-It Lite



Hope RMVB to SVCD DVD VCD



COMMENT Audio CD Players



AVS Video Editor windstorm



Convert Mp4 To Avi



Premier RELIGION



vob to Mkv



IPod VQF to OGG



Evaluate Project Management



Swift DVD iPod YouTube Video to FLV



ApecSoft Audio Stripper



convert flv to AVI



Convert flv to mov



Tuesday, June 29, 2010

How-to DVD Editor

How-to DVD Editor is a powerful and easy-to-use DVD tool, which provides advanced storyboard and timeline editing. Hundreds of effects, including video and text overlay, and chromakey effect, lots of filters and transitions will allow you to create impressive videos, slide-shows and more. Make your home video and save it in format that you need. For your additional convenience we redesigned burning manager in the following way: now DVD, VCD/SVCD and MPEG4 formats are separated from each other to avoid confusion when selecting an appropriate format. Now you can select, adjust or just learn the aspect ratio of your video. The new version provides you with more flexibilty in controlling your video processing. Choose 16:9 (widescreen format) or 4:3 (fullscreen format) aspect ratio according to your liking.An included full-featured Audio Editor, will let you to alter, trim and mix audio tracks for your video project. Moreover you can select and edit necessary audio tracks in AVI and DVD files. Friendly and understandable interface allows you to perform all the operations quick and easily. AVS Video Editor presents a perfect combination of attractive price and high-quality performance.



Recommand Link:



Hot E-Mail Tools



Youtube Movie TO MPEG Platinum



Youtube FLV to Printers Platinum



Apple DVD-Audio MP2 AAC to ID3 Ripping



Reviews Puzzle And Word Games



SAT2PC.TV



1st Cucusoft DVD to PSP Converter



iPod SOUND Deluxe



How to convert DVD to Archos 5



Hope DVD YouTube Video to Pocket PC



Video to Archos 7



Avi



How do I convert video to Sony NWZ-E443



Review Science - Screen Savers



Happiness Divx RM To AVI



Apple CDA Audio APE to WMA Creator



Wednesday, June 16, 2010

Christmasgift DVD Cloner

Christmasgift DVD Clone is a most popular powerful dvd movie clone software. It produces perfect copies every time, and does it quickly and efficiently. Video quality of copied discs is perfect, since there's no recompression or altering of the VOB files from the original disc. Christmasgift DVD Clone was designed to backup your precious DVD without any quality loss. backup you DVDs in 20 mins. Christmasgift DVD Clone comes complete with numerous customizable video/audio controls that can deliver the highest quality viewing and listening experience.

Christmasgift DVD Clone is Burn DVD Video Disc: you can duplicate the DVD or DVD disc which kept in DVD content folder to DVD disc,so that you can watch the DVD from a home DVD player. Duplicate DVD disc from a DVD disc directly, real 1:1 perfectly clone dvd. Copy DVD to the harddisk, so that you can edit or play the dvd from HDD, and burn it to the DVD disc later as a DVD video disc. Christmasgift DVD Clone offers feature-rich navigation controls, for a more interactive and tailored DVD experience. Christmasgift DVD Clone is guaranteed to deliver the highest quality and personalized DVD Copy experience possible on the PC today!



Recommand Link:



Advanced Audio DJ Mixer



does fulltext search feature available in sql azure



Youtube to H264 Utility



Digital AAC WAVE to CD-R Ripping



EZuse DVD To WMV Converter



Hot Recreation



Perpetually MOV XBox 360 Conversion



Open YouTube to iPhone



Ad Blockers Storage



Swift Mobile Divx MOV Deconde



Good-OK WMV Video Converter



Youtube Video to Zune Now



Best Online Gaming



Speed iPhone Video Converter



How-to YouTube to iPod



LasVegas SWF to DVD



ImTOO Music CD Burner Pro New



Thursday, June 3, 2010

Christmas-Idea Youtube Converter



Christmas-Idea Youtube Converter is a All-in-One powerful tool. Convert all popular video and audio formats to Youtube video, swf or flv to video, such as avi, mpeg, 3gp, mp4, mov, it offers the solutions to problems that many other flash to video converting tools cannot solve, such as video and audio asynchronization, loss of frames, audio distortion, the process of alpha channel, and the process of both internal and external Flash video(flv). With the leading audio and video codec, Christmas-Idea Youtube Converter lets you easily and fully enjoy the original effects of your Flash files on your PC, iPod, PSP, Zune, iPhone, DVD players and Youtube Video, Google video, Myspace Video. In conclusion, with easy-to-use interface, fast converting speed, powerful functions.



Recommand Link:



SuperBurner AVI To MPEG



Free Windows Application Downloads



Terminal And Telnet Clients Storage



Compare Vertical Market Apps



Merry MP3 DVD-Audio AC3 To WMA Editor



Youtube Movie to 3GP Professional



Happiness DVD to MPEG4 MPG



Top Calculators And Converters



Digital CD-R Audio ID3 To OGG Copying



Youtube Movie to Treo Application



Youtube Movie to PPC Products



Explosion Pocket PC Converter



SuperBurner MPG To DVD



Wednesday, May 26, 2010

Christmas-Idea DVD to FLV



Christmas-Idea DVD to FLV is a All-in-One powerful tool. Convert all popular video and audio formats to Youtube video, swf or flv to video, such as avi, mpeg, 3gp, mp4, mov, it offers the solutions to problems that many other flash to video converting tools cannot solve, such as video and audio asynchronization, loss of frames, audio distortion, the process of alpha channel, and the process of both internal and external Flash video(flv). With the leading audio and video codec, Christmas-Idea DVD to FLV lets you easily and fully enjoy the original effects of your Flash files on your PC, iPod, PSP, Zune, iPhone, DVD players and Youtube Video, Google video, Myspace Video. In conclusion, with easy-to-use interface, fast converting speed, powerful functions.



Recommand Link:



Vacations DVD To M4V



ColeSoft DVD TO iPod Converter



Youtube Video to PS2 Shareware



Ekos MP3 Minimizer



Helpdesk And Remote PC Guide



Lohan AVI to 3GP



My favorite FTP Servers



Application Software Home



Professional PDA xBox Wii Encode



Bliss DVD-Audio CD ID3 To OGG Editor



How-to DVD To MOV



Shop Registry Tools



Youtube Movie To VOB Products



Saturday, April 17, 2010

Swift DAT DVD Copy


Swift DAT DVD Copy Very easy 400% fast copy DVDs and CDs, Write your data to CD, DVD and even Blu-ray Discs quickly and easily with AVS DAT DVD Copy for FREE. Manage your data storage and make most of it! Real perfectly copy by 1:1 or 1:2 without distortion,Copy DVD to DVD +R/RW,DVD -R/RW with no loss of quality within 10-30 mins.(depends on the spec of your computer). Supports NTSC and PAL Movies.Supports DVD-R/RW, DVD+R/RW. Supports all SCSI,IDE,USB DVD burners/recorder on the marketing.Supports both home / PC DVD Player. Lifetime FREE Technical Support and FREE upgrade for purchase user. Free trial download.30 day money back guarantee.



Supports copy CSS(Content Scrambling System) protected DVD movies (Need advanced Full Version). Copy a dual-layer (D9) movie into one dual-layer (D9) disc. Copy a dual-layer (D9) movie into one regular D5 DVD+R/RW DVD-R/RW Remove unwanted Subtitles/Audios to increase quality. Split DVD-9 into two blanks with all the Special Features,Menus, Subtitles /Languages. Copy DVD to Hard Disk and burn DVD disc from Hard disc. Copy episode DVDs(TV shows on DVD). Remove region protection(Region-free) and Macrovision Protection. Neat User Interface,very easy to use,without any complicated parameter settings . No ASPI drivers needed. You can get DVDs total same as the source DVD discs. Copy DVD very easy. Swift DAT DVD Copy is a best dvd copying software