1
0
Fork 0

Merge pull request #7 from MirkoCovizzi/master

Cleanup GUID string and add more conditional compilation
This commit is contained in:
Mirko Covizzi 2020-05-29 11:31:51 +02:00 committed by GitHub
commit da758e3da4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,7 @@ impl Window {
let mut guid: GUID = MaybeUninit::uninit().assume_init(); let mut guid: GUID = MaybeUninit::uninit().assume_init();
CoCreateGuid(&mut guid); CoCreateGuid(&mut guid);
let class_name = format!( let class_name = format!(
"Baseview-{}-{}-{}-{}{}{}{}{}{}{}{}\0", "Baseview-{:0X}-{:0X}-{:0X}-{:0X}{:0X}-{:0X}{:0X}{:0X}{:0X}{:0X}{:0X}\0",
guid.Data1, guid.Data1,
guid.Data2, guid.Data2,
guid.Data3, guid.Data3,
@ -58,8 +58,7 @@ impl Window {
let _hwnd = CreateWindowExA( let _hwnd = CreateWindowExA(
0, 0,
class_name.as_ptr() as *const i8, class_name.as_ptr() as *const i8,
// todo: change title based on options struct (options.title.to_owned() + "\0").as_ptr() as *const i8,
"Baseview\0".as_ptr() as *const i8,
// todo: fine for now, will have to change with a parent // todo: fine for now, will have to change with a parent
WS_OVERLAPPEDWINDOW | WS_VISIBLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT,