Re: Can't call GetWindowTextW - Error:undefined identifier

2015-06-17 Thread Dan via Digitalmars-d-learn
thank you John it worked :) do I always need do the same for all windows API?

Re: Can't call GetWindowTextW - Error:undefined identifier

2015-06-17 Thread Dan via Digitalmars-d-learn
thank you so much John :)

Re: Can't call GetWindowTextW - Error:undefined identifier

2015-06-17 Thread John Chapman via Digitalmars-d-learn
On Wednesday, 17 June 2015 at 20:50:27 UTC, John Chapman wrote: wchar[MAX_PATH] buffer; int length = GetWindowTextW(GetForegroundWindow(), buffer.ptr, buffer.length); Don't know why I used MAX_PATH there. You should probably dynamically allocate a buffer based on GetWindowTextLengthW.

Re: Can't call GetWindowTextW - Error:undefined identifier

2015-06-17 Thread John Chapman via Digitalmars-d-learn
On Wednesday, 17 June 2015 at 21:00:55 UTC, Dan wrote: thank you John it worked :) do I always need do the same for all windows API? For most Win32 API functions, yes. Although there are some more complete headers on Github (for example, https://github.com/rikkimax/WindowsAPI).

Re: Can't call GetWindowTextW - Error:undefined identifier

2015-06-17 Thread Dan via Digitalmars-d-learn
GetWindowTextW(hWindow, buffer, sizeof(title)); -- Problem here please Ignore the sizeof(title) parameter, I copied that from c++ equivalent code :D

Re: Can't call GetWindowTextW - Error:undefined identifier

2015-06-17 Thread Dan via Digitalmars-d-learn
I'm new to Dlang and I have no Idea whats wrong with this code! wchar[260] buffer; HWND hWindow = GetForegroundWindow(); GetWindowTextW(hWindow, buffer, sizeof(title)); -- Problem here

Re: Can't call GetWindowTextW - Error:undefined identifier

2015-06-17 Thread John Chapman via Digitalmars-d-learn
On Wednesday, 17 June 2015 at 20:40:02 UTC, Dan wrote: I'm new to Dlang and I have no Idea whats wrong with this code! wchar[260] buffer; HWND hWindow = GetForegroundWindow(); GetWindowTextW(hWindow, buffer, sizeof(title)); -- Problem here The compiler is complaining it can't find an