Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Focus per WS_TABSTOP

Empfohlene Antworten

Veröffentlicht

Hi,

ich ein Programm (ohne MFC) mit einem Hauptfenster, das mit CreateWindowEx und dem

Flag WS_EX_CONTROLPARENT erstellt wurde. In dem Fenster sind zwei Buttons die

mit CreateWindow und dem Flag WS_TABSTOP erstellt wurden, der erste Button besitzt

noch das Flag WS_GROUP.

Eigentlich sollte man jetzt mit Tab zwischen den Buttons wählen können, es passiert

jedoch nichts wenn ich Tab drücke.

Hat irgendwer eine Idee was ich falsch mache?

Gruß

Guybrush

  • 2 Monate später...
  • Autor

Ich hab hier mal nen entsprechenden Code dazu:


#include <windows.h>
#include <urlmon.h>

LRESULT CALLBACK MainProc(HWND,UINT,WPARAM,LPARAM);

HWND hMainWindow,
hButton1,
hButton2;

APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MSG Msg;
WNDCLASS wc;

memset(&wc,0,sizeof(WNDCLASS));
wc.hbrBackground = (HBRUSH) COLOR_WINDOWFRAME;
wc.hCursor = LoadCursor(0,IDC_ARROW);
wc.hInstance = hInstance;
wc.lpfnWndProc = MainProc;
wc.lpszClassName ="MainClass";
wc.style = CS_BYTEALIGNCLIENT;

if (!RegisterClass(&wc))
return FALSE;

hMainWindow = CreateWindowEx(WS_EX_CONTROLPARENT,"MainClass","Test",
WS_OVERLAPPEDWINDOW,
200,200,
350,300,
0,0,
hInstance,0);
ShowWindow(hMainWindow,nCmdShow);
UpdateWindow(hMainWindow);

hButton1 = CreateWindow("BUTTON","Button1",
WS_CHILD | WS_TABSTOP,
20,20,
60,30,
hMainWindow,0,
hInstance,0);
ShowWindow(hButton1,nCmdShow);
UpdateWindow(hButton1);

hButton2 = CreateWindow("BUTTON","Button2",
WS_CHILD | WS_TABSTOP,
100,20,
60,30,
hMainWindow,0,
hInstance,0);
ShowWindow(hButton2,nCmdShow);
UpdateWindow(hButton2);


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

LRESULT CALLBACK MainProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_DESTROY:
{
PostQuitMessage(0);
return 0;
}
default:
return DefWindowProc(hWnd,Msg,wParam,lParam);
}
}
[/PHP]

Irgendwer von euch hat das doch bestimmt schon gemacht und

kann mir sagen wo der Fehler ist.

Gruß

Guybrush

  • 3 Wochen später...

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.