i think there are 1*3 loops :P..
am i wrong again ?..
i think there are 1*3 loops :P..
am i wrong again ?..
tadaa this working too..
SystemParametersInfoW(SPI_SETDESKWALLPAPER,0,L"C:\\wallpaper.bmp", SPIF_SENDCHANGE);
what i did..
1. create an empty win32 proj..
2. add a new *.cpp file named "Main.cpp"
3. add a new *.rc file named "Main.rc"
here's my Main.cpp
#include <windows.h>
#include "resource.h"
#define ID_FILE_EXIT 9001
#define ID_STUFF_GO 9002
#define IDD_ABOUT 9003
#define IDD_THIS 9004
#define IDC_STATIC -1
const char g_szClassName[] = "myWindowClass";
BOOL CALLBACK AboutDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
EndDialog(hwnd, IDOK);
break;
case IDCANCEL:
EndDialog(hwnd, IDCANCEL);
break;
}
break;
default:
return FALSE;
}
return TRUE;
}
// Step 4: the Window Procedure
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CREATE:
{
HMENU hMenu, hSubMenu;
hMenu = CreateMenu();
hSubMenu = CreatePopupMenu();
AppendMenu(hSubMenu, MF_STRING, ID_FILE_EXIT, "E&xit");
AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&File");
hSubMenu = CreatePopupMenu();
AppendMenu(hSubMenu, MF_STRING, ID_STUFF_GO, "&Go");
AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&Stuff");
hSubMenu = CreatePopupMenu();
AppendMenu(hSubMenu, MF_STRING, IDD_ABOUT, "&ABOUT");
AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&HELP");
SetMenu(hwnd, hMenu);
//THis code below was commented out due to no icon being used.
/*hIcon = LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE);
if(hIcon)
SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
else
MessageBox(hwnd, "Could not load large icon!", "Error", MB_OK | MB_ICONERROR);
hIconSm = LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
if(hIconSm)
SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIconSm);
else
MessageBox(hwnd, "Could not load small icon!", "Error", MB_OK | MB_ICONERROR);
*/
}
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDD_ABOUT:
{
int ret = DialogBox(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_DIALOGABOUT), hwnd, AboutDlgProc);
if(ret == IDOK)
{
MessageBox(hwnd, …
ofcourse..:p
try this..;)
VOID SetWallpaper(TCHAR *szFilename,INT nStyle)
{
CoInitializeEx(0,COINIT_APARTMENTTHREADED);
IActiveDesktop* iADesktop;
HRESULT status = CoCreateInstance(CLSID_ActiveDesktop,NULL,CLSCTX_INPROC_SERVER,IID_IActiveDesktop,(void**)&iADesktop);
WALLPAPEROPT wOption;
ZeroMemory(&wOption, sizeof(WALLPAPEROPT));
wOption.dwSize=sizeof(WALLPAPEROPT);
switch(nStyle)
{
case 0:
{
wOption.dwStyle = WPSTYLE_STRETCH;
}break;
case 1:
{
wOption.dwStyle = WPSTYLE_TILE;
}break;
case 2:
{
wOption.dwStyle = WPSTYLE_CENTER;
}break;
default:
wOption.dwStyle = WPSTYLE_STRETCH;
}
status = iADesktop->SetWallpaper(szFilename,0);
status = iADesktop->SetWallpaperOptions(&wOption,0);
status = iADesktop->ApplyChanges(AD_APPLY_ALL);
iADesktop->Release();
CoUninitialize();
}
or you should change the dialog ID in the *rc file..
[B]IDD_DIALOGABOUT[/B] DIALOG DISCARDABLE 0, 0, 239, 66
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "My About Box"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "&OK",IDOK,174,18,50,14
PUSHBUTTON "&Cancel",IDCANCEL,174,35,50,14
GROUPBOX "About this program...",IDC_STATIC,7,7,225,52
CTEXT "An example program showing how to use Dialog Boxes\r\n\r\nby Cody",IDC_STATIC,16,18,144,33
END
and
// resource.h
#define IDD_DIALOGABOUT 10000
and..
case IDD_ABOUT:
{
int ret = DialogBox(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_DIALOGABOUT), hwnd, AboutDlgProc);
you've forgotten to include "resource.h"..
use the resource editor to see the ID of the "About Dialog" ..
If you can not find it..then create..
then see the following codes..
// your code
case IDD_ABOUT:
{
int ret = DialogBox(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_ABOUT), hwnd, AboutDlgProc);
// my code..and it worked..
case IDD_ABOUT:
{
int ret = DialogBox(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_DIALOGABOUT), hwnd, AboutDlgProc);
you know what that means..
and why..
the easiest..don't need InitCommonControlsEx(&icex);
nor InitCommonControls();
#pragma comment(linker,"/manifestdependency:\"type='win32 name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
i'm sorry..:)
fill it with zeroes then..
size_t buf_size = wcslen(testString);
memset(testString,0,buf_size);
testString = L"You joking?";
this might work..
strcpy(str, "taskkill /f /im "); //adding a space character after an options..
strcat(str, task3);
yeah right..
total is currency rite..
try this mates..
float total = 0.0f;
...
total = currency (amount,from,to);
system("CLS");
printf("Your currency conversion is: %0.2f\n", total);
Sleep(1500);
...
wow..it's huge..!@#..i'm sorry..
oh man..i'm so tired..old me..
Can you post the complete codes..please..
no errors!!..what should i do for you?..
I don't just want to get a good grade, I want to understand what I'm doing
alright..thats my girl..
simple..just declare it..you know how to do that..rite mates..
how about this..
ifstream myfile(levelMapFile.c_str());
myfile.is_open();
can't find the ID for the HELP button..where is it?..
case [B]ID_ABOUT[/B]:
{
int ret = DialogBox(GetModuleHandle(NULL),
MAKEINTRESOURCE([B]ID_ABOUT[/B]), hwnd, AboutDlgProc);
HINT : use a different command ID from the dialog ID..:)
Thank you for the answer.
- But I cant figure out where, in this code, my own stuff is to be placed.
Well..
Why dont you try it first..
There is another example for you..
/*
* mbstowcs(wchar_t *wcString,char *mbString,size_t nCount);
*/
...
TCHAR *wcBuf=new TCHAR[100];
CHAR *mbBuf="MB STRING";
#ifdef _UNICODE
mbstowcs(wcBuf,mbBuf,100);
#else
strcpy(wcBuf,mbBuf);
#endif
...
delete[]wcBuf;
...
Upss sorry..
mbstowcs(...)
that will help you..
Try
// wcstombs(char *mbstr,const wchar_t *wcstr, size_t count)
//
...
CHAR *mbBuf= new CHAR[100];
TCHAR *wcBuf=_T("hello");
#ifdef _UNICODE
wcstombs(mbBuf,wcBuf,100);
#else
strcpy(mbBuf,wcBuf);
#endif
...
delete[]mbBuf;
...
wcstombs, strcpy are deprecated..
More secure versions are available..
Take care..
It worked with me..
#include <windows.h>
#include <iostream>
//maybe you should add this
#pragma comment(lib,"kernel32.lib")
#pragma comment(lib,"user32.lib")
// this will puts a lib-search record in the object file
using std::cin;
int main()
{
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd,SW_MAXIMIZE);
cin.get();
return 0;
}
Remove the '*'..Should be just 'pvFindPara'..
It's very simple..Just add this..
#include "Form2.h" // or whatever
What's Len?
thats not the important thing..Just have a look at your GlobalAlloc..All you need to do is casting..
Have a look at this point..
//...
int *buf = (int*)GlobalAlloc(GPTR,Len);
//...
Let start with..
//...
md5.getHashFromString(pwd.c_str());
//...
Are u sure it's a keyword..
Actually
DDRAW.LIB
is part of DirectX SDK :)
wow..You guys so fast..
thats why i'm asking him dude..:)..Go on..
You mean this..
;...
mov ah,01
mov al,02
add al,ah
;...
@tux
Sorry dude..
Where did you get that lib..
Try this..
Project | Add Existing Item..Then add DDRAW.H into your project..
// extra variable
Boolean can_exit;
// form closing
if(!can_exit)
e->Cancel::set(true);
// button exit click
can_exit = true;
this->Close();
// form load
can_exit = false;
hope that helps..
I'm new..
Is memory leak problem solved..
Well..Since you already know which one is recommended..Good job dude..
Not bad..Good example for beginners..Whats 'she' do anyway..Checking for ports that's been opened? or what..(sorry for my bad English)
It worked with me..
'...
for each m_row as System.Windows.Forms.DataGridViewRow in me.DataGridView1.Rows
if m_row.Cells("Column1").Value=true then
me.DataGridView1.Rows.Remove(m_row)
end if
next
'...
Hello..:p..Thats rite..
First choices..That'll makes your live easier..
Show me your OnPaint(..) methods..
Replace..
catch(System::Exception ^er)
with
catch(...) //etc..
Try symbian c++..Visit nokia forum for more info..
...
int foreign(int x)
{
int i, j;
i = 2 * x;
if (i > 10)
j = x / 2;
return j - 1;
}
int main(/*..*/)
{
int x=10;
cout << foreign(x) << endl;
return 0;
}
Did u see 'include' folder..
//..
compute::compute(int num1, int num2, int &total)
{
//..
add(num1,num2,total);
}
compute::add(int num1, int num2, int &total)
{
endingtotal=num1+num2;
total=endingtotal;
}
i dono..hope this help..
Who..Me or OP..:p..Nevermind..:p
I see assignment errors..:p