comparison win/wintoast.cpp @ 2114:251d050d306b

Change dw_notification_new() to take an image path instead of an in-memory HPIXMAP. After examining all the platforms, several require the image to be on disk. It is easier to specify the path and load it on platforms requiring it in memory than to save it to disk on platforms that require it on disk. Currently it does not automatically pick an extension like some other functions, may need to add that feature here too soon. Only tested on Windows in this commit.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 23 Jun 2020 07:48:29 +0000
parents 35abef6e33a9
children 663467f6eee4
comparison
equal deleted inserted replaced
2113:aaea278c2356 2114:251d050d306b
96 { 96 {
97 WinToastTemplate *templ = new WinToastTemplate(image ? WinToastTemplate::ImageAndText02 : WinToastTemplate::Text02); 97 WinToastTemplate *templ = new WinToastTemplate(image ? WinToastTemplate::ImageAndText02 : WinToastTemplate::Text02);
98 templ->setTextField(title, WinToastTemplate::FirstLine); 98 templ->setTextField(title, WinToastTemplate::FirstLine);
99 templ->setAttributionText(description); 99 templ->setAttributionText(description);
100 if(image) 100 if(image)
101 templ->setImagePath(image); 101 {
102 WCHAR fullpath[MAX_PATH+1] = {0};
103
104 GetFullPathNameW(image, MAX_PATH, fullpath, NULL);
105 templ->setImagePath(fullpath);
106 }
102 return (void *)templ; 107 return (void *)templ;
103 } 108 }
104 return NULL; 109 return NULL;
105 } 110 }
106 111