Jump to content
xisto Community
Sign in to follow this  
saga

Win32: Dialog Box And Accelerator Win32 API programming

Recommended Posts

ok my problem is how do i make or assign a keyboard accelerator with modal dialog boxes since the message loop is inside the function call of DailogBox() functions, unlike the modeless dialog box in which you are the one who will create the message loop for the dialog box...is it even possible?

Share this post


Link to post
Share on other sites

how to display mbr contents in readable form to view the partition table on console in vc++

Win32: Dialog Box And Accelerator

 

I have written a code to read the mbr. But this displays in ascii. How to convert it into a form which is readable to locate the ext2 fs on the system...

 

// kk.Cpp : Defines the entry point for the console application.

//

 

#include "stdafx.H"

#include<windows.H>

#include<stdio.H>

#include<conio.H>

 

Int _tmain(int argc, _TCHAR* argv[])

{

HANDLE hDriver;

 

hDriver= CreateFile(TEXT(".PHYSICALDRIVE0"),GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,0,OPEN_EXISTING,0,0);

 

printf("%d",hDriver);

 

if (hDriver == INVALID_HANDLE_VALUE) // cannot open the drive

{

printf("%d",GetLastError());

}

 

char data[513]={0};

DWORD dwBytesRead=0;

if( FALSE == ReadFile(hDriver, &data, 512,&dwBytesRead, NULL))

{

printf("Could not read from file (error %d)and", GetLastError());

CloseHandle(hDriver);

return 0;

}

 

if (dwBytesRead > 0)

{

data[dwBytesRead+1]='0'; // NULL character

 

_tprintf(TEXT("Text read from (%d bytes): and"), dwBytesRead);

printf("%sand", data);

}

else

{

_tprintf(TEXT("No data read from file and"));

}

 

CloseHandle(hDriver);

 

 

 

 

Getch();

return 0;

}

 

-reply by pooja

Share this post


Link to post
Share on other sites
win32 console appWin32: Dialog Box And AcceleratorI use Microsoft Visual Studio 9.0 to create win32 console application but when I executeThat program I encounter with one message based on my program is not valid win32 application.Please help me.Thank you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.