shah_animator 0 Report post Posted August 6, 2006 akum..ni ada soklan skit..aku ada dpt soalan final project wat satu program pakai c language.. sebelum ni tak nah blaja pasal c pun pasal aku bukan budak sains komp. atau pun programming, aku budak sis. komp...aku cadang nak wat pogram cam diari.. kira leh masukkan data tentang catatan kehidupan harian..soalanyer.. leh ker c ni wat program berasaskan gui? ada button, gambar, sebab aku tgk sample kat internet semuanyer nampak cam ms dos jer.. klu yg ada gui pun dia pakai c++... c tak leh ker?tu jer.. harap korang dpt tolong.. (aku dah berjaya wat hello world.. lol) Quote Share this post Link to post Share on other sites
Navigator® 6 Report post Posted August 6, 2006 (edited) akum..ni ada soklan skit..aku ada dpt soalan final project wat satu program pakai c language.. sebelum ni tak nah blaja pasal c pun pasal aku bukan budak sains komp. atau pun programming, aku budak sis. komp...aku cadang nak wat pogram cam diari.. kira leh masukkan data tentang catatan kehidupan harian..soalanyer.. leh ker c ni wat program berasaskan gui? ada button, gambar, sebab aku tgk sample kat internet semuanyer nampak cam ms dos jer.. klu yg ada gui pun dia pakai c++... c tak leh ker?tu jer.. harap korang dpt tolong.. (aku dah berjaya wat hello world.. lol)mmg kena guna C ka?ko dah try ke cari souce code , for VB? try la google[tak pandai sangat bab programming .. hehehe but i got 1A in SPM dalam bahasa pengaturcaraan VB huhuh] Edited August 6, 2006 by Navigator® Quote Share this post Link to post Share on other sites
ahmades 2 Report post Posted August 6, 2006 Hehehe.... tahniah kepada ko berjaya buat output hello world.. hehe...Untuk cipta GUI dalam C pertama sekali kena ada dia punya Visual Simulator. Biasanya, aku pakai Microsoft Visual C++ untuk benda-benda GUI dalam C nih. Senang skit kalau nak dibandingkan dengan Borland tapi Borland is much powerful than Visual C++. Quote Share this post Link to post Share on other sites
Navigator® 6 Report post Posted August 6, 2006 Hehehe.... tahniah kepada ko berjaya buat output hello world.. hehe...Untuk cipta GUI dalam C pertama sekali kena ada dia punya Visual Simulator. Biasanya, aku pakai Microsoft Visual C++ untuk benda-benda GUI dalam C nih. Senang skit kalau nak dibandingkan dengan Borland tapi Borland is much powerful than Visual C++.haaa.. dengar tuh Sifo aku ajar .. huhuhuhu Quote Share this post Link to post Share on other sites
ahmades 2 Report post Posted August 6, 2006 haaa.. dengar tuh Sifo aku ajar .. huhuhuhuHaih... banyak lagi orang yang lebih tau mengenai C berbading aku yang tak beberapa pandai nih ....... Quote Share this post Link to post Share on other sites
pengguna_komputer 0 Report post Posted August 6, 2006 Acu cuba try test guna Pelles C,Features: * Integrated resource editor. * Integrated bitmap, icon and cursor editor. * Integrated animated cursor and video editor. * Integrated hex-dump editor. * Integrated source-level debugger. * Integrated source code editor with Win32 API call tips. * Project management. * Inline assembler with Intel syntax. * Support for custom controls in the dialog editor. * Support for additional project wizards. * Support for Microsoft's exception handling: __try, __except, __finally, __leave. * Support for Microsoft's new import libraries. * Support for delayed loading of DLL's, much like Microsoft. * Support for most C99 features. * Support for Pocket PC. * Pelles C is free!Pelles C Quote Share this post Link to post Share on other sites
Ancient One 3 Report post Posted August 7, 2006 GUI stands for Graphical User Interface. Untuk bina program berasaskan GUI, u kena guna programming interface yang disediakan oleh GUI-based system, e.g Windows, X, dan sebagainya. The language itself hanya provide kemudahan untuk akses programming interface ni. In case u guna Windows, bleh refer kepada Platform SDK nyer documentation, download foc kat M$ nyer website. Quote Share this post Link to post Share on other sites
shah_animator 0 Report post Posted August 7, 2006 hurm.. skang ni aku pakai / install dua compiler.. pelles c ngan visual c++ 6.0ni pic utk program yg aku wat pakai pelles c... visual c++ 6.0 aku tak try lagi..aku tak tau lagi camner nak wat bila klik button about keluar menu about.. klik button address book keluar menu address book..sample program.. tak siap lagi.. http://www.freewebs.com/shah_animator/Diari.ziporhttp://www.freewebs.com/shah_animator/download.htm Quote Share this post Link to post Share on other sites
PinguSpy 3 Report post Posted August 7, 2006 [hmm... hebat gak prog yg ko buat...aku buat program kalkulator jer untuk add math heher....C memang besh!! Quote Share this post Link to post Share on other sites
Navigator® 6 Report post Posted August 7, 2006 hurm.. skang ni aku pakai / install dua compiler.. pelles c ngan visual c++ 6.0ni pic utk program yg aku wat pakai pelles c... visual c++ 6.0 aku tak try lagi..aku tak tau lagi camner nak wat bila klik button about keluar menu about.. klik button address book keluar menu address book..sample program.. tak siap lagi.. http://www.freewebs.com/shah_animator/Diari.ziporhttp://www.freewebs.com/shah_animator/download.htmerkk..meh cuba about buttondekat command untuk setiap button ko letak msg box or create new formfor example MsgBox "about me blah blah blah"kalau ko nak letak style or lebih advance kena buat satu satu , kena buat ikut formula Quote Share this post Link to post Share on other sites
shah_animator 0 Report post Posted August 7, 2006 [hmm... hebat gak prog yg ko buat...aku buat program kalkulator jer untuk add math heher....C memang besh!!program aku tu mana hebat sangat.. aku main drag & drop jer button tu..erm navigator.. aku main drag and drop jer.. so kurang skit bila masuk bab command ni.. (masih blur lagi..)aku cari untuk command utk button takder pun.. ni source code dia.. utk main.ccam ner ek nak wat message box tu.. (aku pakai pelles c)/**************************************************************************** * * * File : main.c * * * * Purpose : Generic dialog based Win32 application. * * * * History : Date Reason * * 00/00/00 Created * * * ****************************************************************************//* * Either define WIN32_LEAN_AND_MEAN, or one or more of NOCRYPT, * NOSERVICE, NOMCX and NOIME, to decrease compile time (if you * don't need these defines -- see windows.h). */#define WIN32_LEAN_AND_MEAN/* #define NOCRYPT *//* #define NOSERVICE *//* #define NOMCX *//* #define NOIME */#include <windows.h>#include <windowsx.h>#include <commctrl.h>#include <tchar.h>#include "main.h"/** Prototypes **************************************************************/static LRESULT CALLBACK MainDlgProc(HWND, UINT, WPARAM, LPARAM);/** Global variables ********************************************************/static HANDLE ghInstance;/**************************************************************************** * * * Function: WinMain * * * * Purpose : Initialize the application. Register a window class, * * create and display the main window and enter the * * message loop. * * * * History : Date Reason * * 00/00/00 Created * * * ****************************************************************************/int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow){ WNDCLASSEX wcx; ghInstance = hInstance; // Initialize common controls. Also needed for MANIFEST's. InitCommonControls(); // Load Rich Edit control support. // TODO: uncomment one of the lines below, if you are using a Rich Edit control. // LoadLibrary(_T("riched32.dll")); // Rich Edit v1.0 // LoadLibrary(_T("riched20.dll")); // Rich Edit v2.0, v3.0 // Get system dialog information. wcx.cbSize = sizeof(wcx); if (!GetClassInfoEx(NULL, MAKEINTRESOURCE(32770), &wcx)) return 0; // Add our own stuff. wcx.hInstance = hInstance; wcx.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDR_ICO_MAIN)); wcx.lpszClassName = _T("DiariClass"); if (!RegisterClassEx(&wcx)) return 0; // The user interface is a modal dialog box. return DialogBox(hInstance, MAKEINTRESOURCE(DLG_MAIN), NULL, (DLGPROC)MainDlgProc);}/**************************************************************************** * * * Function: MainDlgProc * * * * Purpose : Process messages for the Main dialog. * * * * History : Date Reason * * 00/00/00 Created * * * ****************************************************************************/static LRESULT CALLBACK MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam){ switch (uMsg) { case WM_INITDIALOG: /* * TODO: Add code to initialize the dialog. */ return TRUE; case WM_SIZE: /* * TODO: Add code to process resizing, when needed. */ return TRUE; case WM_COMMAND: switch (GET_WM_COMMAND_ID(wParam, lParam)) { /* * TODO: Add more control ID's, when needed. */ case IDOK: EndDialog(hwndDlg, TRUE); return TRUE; } break; case WM_CLOSE: EndDialog(hwndDlg, 0); return TRUE; /* * TODO: Add more messages, when needed. */ } return FALSE;} Quote Share this post Link to post Share on other sites
Ancient One 3 Report post Posted August 8, 2006 Cuba add satu button dan berikan Nama IDC_BTN_TEST (double click button nih dan tukar "Name" property). Untuk berikan command kepada button ni, kena tambah kod kat di bawah komen /* TODO: Add more control ID's, when needed.*/ tu. Contohnya, untuk paparkan message box bila button ni diklik, kod yang berkaitan adalah : static LRESULT CALLBACK MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_INITDIALOG: /* * TODO: Add code to initialize the dialog. */ return TRUE; case WM_SIZE: /* * TODO: Add code to process resizing, when needed. */ return TRUE; case WM_COMMAND: switch (GET_WM_COMMAND_ID(wParam, lParam)) { /* * TODO: Add more control ID's, when needed. */ /*kita tambah kod di sini*/ case IDC_BTN_TEST: MessageBox(hwndDlg, _T("Hello World"), _T("Test"), MB_ICONINFORMATION); return TRUE; /*------------------------*/ case IDOK: EndDialog(hwndDlg, TRUE); return TRUE; } break; case WM_CLOSE: EndDialog(hwndDlg, 0); return TRUE; /* * TODO: Add more messages, when needed. */ } Program yang u develop kat atas gunakan dialog box sebagai main window... biasanya orang tak buat camni (tapi of course laa tak salah) dan fungsi MainDlgProc tu adalah DialogProc untuk main dialog u dan kat sini laa u handle semer message dari sistem atau user. e.g mesej WM_CLOSE, WM_INITDIALOG, WM_SIZE dan macam2 lagi laa.. as u need to handle more messages, u tambah laa handler under block switch(uMsg) nih. Quote Share this post Link to post Share on other sites
Navigator® 6 Report post Posted August 8, 2006 Cuba add satu button dan berikan Nama IDC_BTN_TEST (double click button nih dan tukar "Name" property). Untuk berikan command kepada button ni, kena tambah kod kat di bawah komen /* TODO: Add more control ID's, when needed.*/ tu. Contohnya, untuk paparkan message box bila button ni diklik, kod yang berkaitan adalah : static LRESULT CALLBACK MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_INITDIALOG: /* * TODO: Add code to initialize the dialog. */ return TRUE; case WM_SIZE: /* * TODO: Add code to process resizing, when needed. */ return TRUE; case WM_COMMAND: switch (GET_WM_COMMAND_ID(wParam, lParam)) { /* * TODO: Add more control ID's, when needed. */ /*kita tambah kod di sini*/ case IDC_BTN_TEST: MessageBox(hwndDlg, _T("Hello World"), _T("Test"), MB_ICONINFORMATION); return TRUE; /*------------------------*/ case IDOK: EndDialog(hwndDlg, TRUE); return TRUE; } break; case WM_CLOSE: EndDialog(hwndDlg, 0); return TRUE; /* * TODO: Add more messages, when needed. */ } Program yang u develop kat atas gunakan dialog box sebagai main window... biasanya orang tak buat camni (tapi of course laa tak salah) dan fungsi MainDlgProc tu adalah DialogProc untuk main dialog u dan kat sini laa u handle semer message dari sistem atau user. e.g mesej WM_CLOSE, WM_INITDIALOG, WM_SIZE dan macam2 lagi laa.. as u need to handle more messages, u tambah laa handler under block switch(uMsg) nih.hokhokhok aku tak pandai bahasa C ... aku tau visual asas je... hokhokhok ^^ Quote Share this post Link to post Share on other sites
pengguna_komputer 0 Report post Posted August 8, 2006 Jom le pakat2 belajar bahasa Cbaru la dapat tau keindahan bahasanya ... Quote Share this post Link to post Share on other sites
shah_animator 0 Report post Posted August 8, 2006 ancient one... thanks utk command tu.. aku dah leh wat message box.. untuk button about.. (tukar info sebab nak wat program bahasa melayu.. klu tulis tentang jadi pelik lak.. ni code yg aku pakai..case IDC_BTN_TEST: MessageBox(hwndDlg, _T(" Diari Versi 1.0.\n Aplikasi ini dibangunkan untuk memudahkan pelajar menguruskan kehidupan seharian mereka.\n Aplikasi ini adalah percuma, ia boleh diedar dan diguna untuk kegunaan peribadi.\n"), _T("Info"), MB_ICONINFORMATION); return TRUE;hurm aku nak try explore lagi untuk wat interface diari, buku alamat dan galeri (picture gallery..) Quote Share this post Link to post Share on other sites
pengguna_komputer 0 Report post Posted August 8, 2006 Congrat Shah.. Apapun perkembangan projek kau... Update kan lah kat sini..Saya belum sampai tahap win32 API programming lg nih..Still wat program utk console....Still far away to go... Quote Share this post Link to post Share on other sites
Ancient One 3 Report post Posted August 9, 2006 bleh jugak buat about box yg lebih kompleks dengan satu lagi dialog box, gunakan DialogBox api. aper2 pun tu cuma contoh jer, basically u bleh letak aper yg u nak sebagai handler untuk button click tu. Quote Share this post Link to post Share on other sites
PinguSpy 3 Report post Posted August 9, 2006 [apasal susah sangat huh nak download peles C ??baru 10% dan habis download...kadang-kadang aku dengan best nya downlod 70% dah habis download....bila aku bukak file error sebab tak habis download lagi!! Quote Share this post Link to post Share on other sites
Navigator® 6 Report post Posted August 19, 2006 tumpang thread .. aku ada prob sket nehcuba check code aku #include <stdio.h> main () { cout << "blah blah blah"; << end1 << "blah blah blah"; << end1 << "blah blah blah "; <<end1 <<end1 return 0; } apsal aku compile.. ada debg kat cout? im newbie.. just baru blaja c Quote Share this post Link to post Share on other sites
b1naryc0de 1 Report post Posted August 20, 2006 Heheh navigator.. sebab ko salah guna library (include)..cout tu untuk c++.. dan library untuk cout ialah iostream.h bukan stdio.h.. kalo pakai stdio.h ko takleh guna cout tapi ko guna printf() untuk paparkan output.. Selamat mencuba.. Quote Share this post Link to post Share on other sites
Navigator® 6 Report post Posted August 21, 2006 Heheh navigator.. sebab ko salah guna library (include)..cout tu untuk c++.. dan library untuk cout ialah iostream.h bukan stdio.h.. kalo pakai stdio.h ko takleh guna cout tapi ko guna printf() untuk paparkan output.. Selamat mencuba..owh... salah libary la nih...ok ok aku try guna isotream.hthks Quote Share this post Link to post Share on other sites
shah_animator 0 Report post Posted August 21, 2006 (edited) erm.. dah lama tak pos.. ni aku prob baru.. nak link satu button ngan satu dialog lain.. button tu aku letak nama IDC_MANUAL dan dialog tu aku letak IDM_MANUALni code yang aku wat.case IDC_MANUAL:(kat sini tak tau nak letak aper.. klu letak messagebox dia akan wat dialog baruu..)return TRUE;ni gambar dialog tuni gambar main dialog (tempat button IDC_MANUAL tu)dan ada lagi satu.. camner nak wat hyperlink kat dialog Info untuk ke website... (gambar lain dari yang asal..)case IDC_BTN_TEST:MessageBox(hwndDlg, _T(" Diari Versi 1.0.\n Aplikasi ini dibangunkan untuk memudahkan pelajar menguruskan kehidupan seharian mereka.\n Aplikasi ini adalah percuma, ia boleh diedar dan diguna untuk kegunaan peribadi.\n http://www.freewebs.com/ediari\n"), _T("Info"), MB_ICONINFORMATION);return TRUE;ni link untuk aplikasi yang aku tgh bangunkan ni.. kira cam official website.. http://www.freewebs.com/ediari/ Edited August 22, 2006 by shah_animator Quote Share this post Link to post Share on other sites
encik pot pet 0 Report post Posted August 25, 2006 utk masalah hyperlink ko tu, aku rasa contoh yg terbaik kat http://www.codeproject.com/useritems/Win32EasyHyperLink.aspko pakai resource editor apa nak buat gui tu?aku dah test ediari anda, and mcm takde apa2 langsung , hanyalah gui semata2. bila nak siap tu? tak sabar nak pakai. Quote Share this post Link to post Share on other sites
Ancient One 3 Report post Posted August 26, 2006 hyperlink bleh gunakan "syslink" control. dan untuk paparkan dialog box baru, bleh gunakan DialogBox* API. sila rujuk psdk untuk keterangan lanjut. Quote Share this post Link to post Share on other sites