Re: Windows system casting

2016-06-06 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 7 June 2016 at 04:06:01 UTC, Mike Parker wrote: Fourth, while casting the string directly to void* will work, it's considered best practice to use the pointer property for clarity. Oops! cast(void*)path.ptr In both cases. Like I said, without .ptr, it works, but this makes

Re: Windows system casting

2016-06-06 Thread Mike Parker via Digitalmars-d-learn
On Monday, 6 June 2016 at 19:52:36 UTC, Alexander Patapoff wrote: import std.stdio; import std.string; import core.sys.windows.windows; void main() { string filepath = "C:\\Users\\awpat\\Pictures\\patterns_00387591.jpg"; auto p = toStringz(filepath); int result;

Windows system casting

2016-06-06 Thread Alexander Patapoff via Digitalmars-d-learn
import std.stdio; import std.string; import core.sys.windows.windows; void main() { string filepath = "C:\\Users\\awpat\\Pictures\\patterns_00387591.jpg"; auto p = toStringz(filepath); int result; result = SystemParametersInfo(cast(uint)SPI_SETDESKWALLPAPER,