|
Using win32 without resources because I don't even want to try to get GCC to embed and even then I'd still have to use VS code to generate RC files and figure all that out. No. Just, no.
And I have to use GCC because it's an Arduino port to PC for prototyping, and all the Arduino toolchains use GCC.
So I've been building my windows using CreateWindowExW(). Joy.
And a lot of the User32.dll API just assumes you'll be using resources. It's actually a bit of a black art to forgo them.
This is rough stuff.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
I remember having to do that a long time ago. Win32 API's are so much fun 😉
|
|
|
|
|
It has been a long time since I've played with that aspect, but I believe the only resources in my DWinLib 6 Windows Wrapper examples are the main icon and the icons for toolbars and such. Not using toolbars gets rid of one. I'm not certain about the main icon, though. Maybe if you NULL the one of the CreateWindowExW parameters it defaults to default, and that would get rid of that resource. Like I said, it has been a long time. Such a long time, in fact that I don't think it compiled on GCC originally because it didn't handle true Unicode programs (or something), but that may have changed.
|
|
|
|
|
It's not so much about icons and such.
It's that WM_COMMAND and various window messages and API calls want dialog IDs for things, and if you're not using resources you don't have them.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
If you create a child window of a dialog, usually a control, the HMENU field is a resource identifier so you actually do have them since controls generally do not have menus. This is true of both CreateWindow and CreateWindowEx and the identifiers have to be unique for all controls in a dialog.
ETA: there is a handy function, GetDlgItem, that will give you a handle to a control in a dialog. It is handy because if you use it then you don't have to save handles to the controls.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Right, and I set them to negative numbers so that if i ever do add resources they won't collide.
Guess I stated things poorly.
The documentation however, isn't geared for doing it this way, so things get a bit iffy especially since all the example code is with loading resources.
It's doable, it's just taking me longer than I otherwise would.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Dive into my code more deeply. I'm not at my desk now, but each control automatically gets assigned a unique ID for that purpose. Maybe my WinControl unit shines a light on it somehow. I think it contains an object that gets the ID during construction. I mention it in some article somewhere. If you want more details it will have to wait until late tonight when I get off shift.
|
|
|
|
|
Here's what I do - because I only need to do this for dynamic menus:
Of note is this: mif.wID = (~i); which yields a negative ID I can reconstitute into a gpio id by repeating the ~ operator on it.
static void update_gpios() {
updating_gpios = true;
while(GetMenuItemCount(gpio_menu)) {
RemoveMenu(gpio_menu,0,MF_BYPOSITION);
}
wchar_t name[256];
for(size_t i = 0; i < 256; ++i) {
gpio_t& g = gpios[i];
if(g.mode!=0) {
wcscpy(name,L"GPIO ");
_itow((int)i,name+wcslen(name),10);
switch(g.mode) {
case INPUT:
case INPUT_PULLDOWN:
case INPUT_PULLUP:
wcscat(name,L" <");
break;
case OUTPUT:
case OUTPUT_OPEN_DRAIN:
wcscat(name,L" >");
}
MENUITEMINFOW mif;
mif.cbSize = sizeof(MENUITEMINFOW);
mif.cch = wcslen(name);
mif.dwTypeData = name;
mif.fMask = MIIM_STRING | MIIM_ID | MIIM_STATE;
mif.wID = (~i);
mif.fState = g.value==0?MFS_UNCHECKED:MFS_CHECKED;
InsertMenuItemW(gpio_menu,GetMenuItemCount(gpio_menu),TRUE,&mif);
}
if(g.hwnd_text!=NULL) {
wchar_t val[64];
if(!g.is_input()) {
if(g.value==HIGH) {
wcscpy(val,L"HIGH");
} else if(g.value==LOW) {
wcscpy(val,L"LOW");
} else {
_itow(g.value,val,10);
}
if(GetFocus()!=g.hwnd_text) {
SetWindowTextW(g.hwnd_text, val);
}
}
EnableWindow(g.hwnd_text,g.is_input()?TRUE:FALSE);
}
}
updating_gpios = false;
}
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Menus in Windows are a bitch. I believe the convoluted code behind the scenes may be the real reason MS went to ribbons. Maybe my WinMenu unit helps you - I don't know.
|
|
|
|
|
I've got it sorted now. I'm keeping this UI very vanilla. It's mostly just a shim to make Arduino work on a Windows machine so I don't need much.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Ps - maybe the WinCallbackItem unit helps.
|
|
|
|
|
You remind me old times... And make me wonder why would I do that as today...
"If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization." ― Gerald Weinberg
|
|
|
|
|
Coding a windows app in GCC. I don't even want to try to get MFC to compile with it.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
I'm working in GCC, which is a requirement for this project.
As such, I can't necessarily use things like MFC as I'm not sure their headers will compile with GCC. I haven't tried, honestly but see, because even if I did, I lack the resource editor needed to visually lay out the controls, not using visual studio.
So I'm kind of stuck with what I have.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Use Resource Hacker: Resource Hacker
It'll create the RC fles as per normal, or you can get it to spit out the C code for creating a drawn dialog.
It's what I use whenever I'm doing windows stuff with gcc.
Here's one of the lines during the build:
windres.exe -J rc -O coff -i C:\Users\enhzf\DOCUME~1\code\GALLER~1\resource.rc -o obj\Debug\galleryPreview\resource.res
Can't remember the linking one, and unfortunately, this project won't build on this machine yet.
EDIT: still won't build, but I got it to spit out the linking line. Nothing special - just include the res file.
g++.exe -o bin\Debug\galleryPreview.exe obj\Debug\cStaticLink\cStaticLink.o obj\Debug\galleryPreview\main.o obj\Debug\galleryPreview\network.o obj\Debug\galleryPreview\resource.res -lgdi32 -luser32 -lkernel32 -lcomctl32 -lws2_32 -lOle32 -lwinmm
|
|
|
|
|
Oh wow, thank you!
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Hello,
I feel quite lost...
New laptop (bought this spring) using Windows 11 Pro with MS 365, however I guess I didn't have to install MS Teams at the beginning as I already had it.
In the first weeks, everything worked well, but ... suddenly:
- MS Teams seems have turned into a chat-only application.
No phone calls therein.
No camera connected although I do have one!
Cannot even join an invitation I sent...
- But I need a video-chat application.
- Best, some that works on Windows 11 and lets people with Mac/Linux join as I invite them
- For example for such useful and important things as online jobs interviews?
What has happened to MS Teams? How can I fix this?
Any ideas?
|
|
|
|
|
|
Apparently, MS Teams has "back doors". It may be a work in progress.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I lose sound or video in MS Teams whenever my laptop sleeps. Rebooting fixes it though (and now I use hibernate before I unplug my laptop so it doesn't sleep).
|
|
|
|
|
So, what happens when you try to reinstall it? https://teams.microsoft.com has a "Get the Windows app" button to download the native Win32 EXE.
Failing that, I'd be surprised if the web client didn't work. And frankly I don't see much difference between it and the EXE.
|
|
|
|
|
The web client is apparently prompting me to install the app (which is, although I do have Teams app...)
All of that redirects me to https://teams.live.com/_#/unsupportedBrowser[^]
My Teams app differs from the 2021 version of Teams shown in picture here Redirecting[^] in that mine only shows: Activity, Community, Chat, Calendar. No "Meetings", "Calls", "three dots menu". So I must have a newer version of MS Teams than that in the link below. However I cannot find a version number anyhow 
|
|
|
|
|
Sounds like your trial period ended and you need to buy a license.
|
|
|
|
|
Well, but... I didn't get any period-ending reminder or notice beforehand. This keeps on puzzling me more and more...
|
|
|
|
|
The Teams that ships with Windows 11 is really just a chat application and should be uninstalled if you want the full Teams. What you're looking for is Microsoft Teams (Work or School) and you can download it from https://teams.microsoft.com (assuming you have a M365 Teams account that includes Teams).
|
|
|
|