C#nedir?com Homepage
Forum Home Forum Home > C/C++ > C / C++ ve C++.NET
  New Posts New Posts RSS Feed - Tab Control için örnek kod verebilirmisiniz?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Tab Control için örnek kod verebilirmisiniz?

 Post Reply Post Reply
   

Author
Message
KurtbeyACR View Drop Down
Newbie
Newbie


Joined: 04 Kasım 2017
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote KurtbeyACR Quote  Post ReplyReply Direct Link To This Post Topic: Tab Control için örnek kod verebilirmisiniz?
    Posted: 04 Kasım 2017 at 08:49
Tab Control için Windows 10 da çalışacak Win32 C kodu verebilirmisiniz. Gerisini ben anlarım iki tab yeterli. Old school olsun lütfen.
Back to Top
KurtbeyACR View Drop Down
Newbie
Newbie


Joined: 04 Kasım 2017
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote KurtbeyACR Quote  Post ReplyReply Direct Link To This Post Posted: 04 Kasım 2017 at 10:42
#include <windows.h>
#include <commctrl.h>

char className[]="TabControl";

LRESULT CALLBACK WindowProcedure(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpszArgument,int){
    MSG messages;
    WNDCLASSEX wincl;

    wincl.hInstance=hInstance;
    wincl.lpszClassName=className;
    wincl.lpfnWndProc=WindowProcedure;
    wincl.style=0;
    wincl.cbSize=sizeof(WNDCLASSEX);
    wincl.hIcon=LoadIcon(NULL,IDI_APPLICATION);
    wincl.hIconSm=LoadIcon(NULL,IDI_APPLICATION);
    wincl.hCursor=LoadCursor(NULL,IDC_ARROW);
    wincl.lpszMenuName=NULL;
    wincl.cbClsExtra=0;
    wincl.cbWndExtra=0;
    wincl.hbrBackground=HBRUSH(COLOR_3DFACE+1);

    if(!RegisterClassEx(&wincl))return 0;

    HWND windowHandle=CreateWindow(className,"TabControl",WS_OVERLAPPEDWINDOW,200,325,480,320,NULL,NULL,hInstance,NULL);
    ShowWindow(windowHandle,SW_SHOW);

    HWND tabHandle=CreateWindow(WC_TABCONTROL,"",WS_CHILD | WS_VISIBLE,6,0,474,320,windowHandle,NULL,hInstance,NULL);
    TCITEM tab1Data;
    tab1Data.mask=TCIF_TEXT;
    tab1Data.pszText="Tab1";
    TabCtrl_InsertItem(tabHandle,0,&tab1Data);
    TCITEM tab2Data;
    tab2Data.mask=TCIF_TEXT;
    tab2Data.pszText="Tab2";
    TabCtrl_InsertItem(tabHandle,0,&tab2Data);


    ShowWindow(tabHandle,SW_SHOW);

    while(GetMessage(&messages,NULL,0,0)){
        TranslateMessage(&messages);
        DispatchMessage(&messages);
    };
    return messages.wParam;
}

LRESULT CALLBACK WindowProcedure (HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
    switch(message){
        case WM_DESTROY:
            PostQuitMessage(0);
            break;
        default:
            return DefWindowProc(hwnd,message,wParam,lParam);
    };
    return 0;
}


Edited by KurtbeyACR - 04 Kasım 2017 at 10:44
Back to Top
 Post Reply Post Reply
  Share Topic   
   


Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.